From 05fae447c47d9a2089443e4d907fb6abfd08cfe6 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Fri, 31 May 2019 12:58:38 +0600 Subject: [PATCH 01/25] Added chart for Function and Task for postgres-stash --- Makefile | 4 +- chart/README.md | 68 +++++++++++++++++++ chart/postgres-stash/.helmignore | 22 ++++++ chart/postgres-stash/Chart.yaml | 12 ++++ chart/postgres-stash/templates/NOTES.txt | 7 ++ chart/postgres-stash/templates/_helpers.tpl | 40 +++++++++++ .../templates/pg-backup-function.yaml | 45 ++++++++++++ .../templates/pg-backup-task.yaml | 22 ++++++ .../templates/pg-restore-function.yaml | 36 ++++++++++ .../templates/pg-restore-task.yaml | 22 ++++++ .../templates/update-status-function.yaml | 16 +++++ chart/postgres-stash/values.yaml | 15 ++++ 12 files changed, 307 insertions(+), 2 deletions(-) create mode 100644 chart/README.md create mode 100644 chart/postgres-stash/.helmignore create mode 100644 chart/postgres-stash/Chart.yaml create mode 100644 chart/postgres-stash/templates/NOTES.txt create mode 100644 chart/postgres-stash/templates/_helpers.tpl create mode 100644 chart/postgres-stash/templates/pg-backup-function.yaml create mode 100644 chart/postgres-stash/templates/pg-backup-task.yaml create mode 100644 chart/postgres-stash/templates/pg-restore-function.yaml create mode 100644 chart/postgres-stash/templates/pg-restore-task.yaml create mode 100644 chart/postgres-stash/templates/update-status-function.yaml create mode 100644 chart/postgres-stash/values.yaml diff --git a/Makefile b/Makefile index ccad34d18..bbe588c47 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= postgres:9.5-alpine -BASEIMAGE_DBG ?= postgres:9.5 +BASEIMAGE_PROD ?= postgres:9.6-alpine +BASEIMAGE_DBG ?= postgres:9.6 IMAGE := $(REGISTRY)/$(BIN) VERSION_PROD := $(VERSION) diff --git a/chart/README.md b/chart/README.md new file mode 100644 index 000000000..0e943058a --- /dev/null +++ b/chart/README.md @@ -0,0 +1,68 @@ +# Postgres-stash + +[Postgres-stash by AppsCode](https://github.com/stashed/postgres-stash) - PostgreSQL database backup/restore plugin for [Stash](https://github.com/stashed/). + +## TL;DR; + +```console +helm repo add appscode https://charts.appscode.com/stable/ +helm repo update +helm install appscode/postgres-stash --name postgres-stash +``` + +## Introduction + +This chart installs necessary `Function` and `Task` crd to backup/restore PostgreSQL database using Stash. + +## Prerequisites + +- Kubernetes 1.9+ + +## Installing the Chart + +To install the chart with the release name `postgres-stash`: + +```console +helm install appscode/postgres-stash --name postgres-stash +``` + +The command installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database using Stash. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall/delete the `postgres-stash`: + +```console +helm delete postgres-stash +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following table lists the configurable parameters of the Postgre-stash chart and their default values. + +| Parameter | Description | Default | +| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| `docker.registry` | Docker registry used to pull respective images | `appscode` | +| `docker.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | +| `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.6` | +| `pgArgs` | Optional arguments to pass to `psql`/`pgdump` command | | +| `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | +| `metrics.labels` | Optional comma separated labels to add the Prometheus metrics | | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +For example: + +```console +helm install --name postgres-stash --set metrics.enabled=false appscode/postgres-stash +``` + +**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `metrics.labels`. + +```console + helm install chart/postgres-stash --set metrics.labels="k1=v1\,k2=v2" +``` diff --git a/chart/postgres-stash/.helmignore b/chart/postgres-stash/.helmignore new file mode 100644 index 000000000..50af03172 --- /dev/null +++ b/chart/postgres-stash/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml new file mode 100644 index 000000000..5c71508db --- /dev/null +++ b/chart/postgres-stash/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +description: 'Postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash' +name: postgres-stash +version: 9.6 +appVersion: 9.6 +home: https://github.com/stashed/postgres +icon: https://cdn.appscode.com/images/icon/stash.png +sources: + - https://github.com/stashed/postgres +maintainers: + - name: appscode + email: support@appscode.com diff --git a/chart/postgres-stash/templates/NOTES.txt b/chart/postgres-stash/templates/NOTES.txt new file mode 100644 index 000000000..7cf46a615 --- /dev/null +++ b/chart/postgres-stash/templates/NOTES.txt @@ -0,0 +1,7 @@ +To verify that all Functions are installed successfully, run: + + kubectl get functions + +To verify that all Tasks are installed successfully, run: + + kubectl get task \ No newline at end of file diff --git a/chart/postgres-stash/templates/_helpers.tpl b/chart/postgres-stash/templates/_helpers.tpl new file mode 100644 index 000000000..d407bbf87 --- /dev/null +++ b/chart/postgres-stash/templates/_helpers.tpl @@ -0,0 +1,40 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "postgres-stash.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "postgres-stash.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "postgres-stash.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +# default labels for posgres-stash resources +{{- define "postgres-stash.labels" -}} +app.kubernetes.io/name: {{ include "postgres-stash.name" . }} +helm.sh/chart: {{ include "postgres-stash.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} diff --git a/chart/postgres-stash/templates/pg-backup-function.yaml b/chart/postgres-stash/templates/pg-backup-function.yaml new file mode 100644 index 000000000..ff61de530 --- /dev/null +++ b/chart/postgres-stash/templates/pg-backup-function.yaml @@ -0,0 +1,45 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: pg-backup + labels: + {{- include "postgres-stash.labels" . | nindent 4 }} +spec: + image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{- .Values.docker.tag }} + args: + - backup-pg + # setup information + - --provider=${REPOSITORY_PROVIDER:=} + - --bucket=${REPOSITORY_BUCKET:=} + - --endpoint=${REPOSITORY_ENDPOINT:=} + - --rest-server-url=${REPOSITORY_URL:=} + - --path=${REPOSITORY_PREFIX:=} + - --secret-dir=/etc/repository/secret + - --scratch-dir=/tmp + - --enable-cache=${ENABLE_CACHE:=true} + - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit + - --hostname=${HOSTNAME:=} + - --pg-args=${pgArgs:={{ .Values.pgArgs }}} # optional arguments pass to pgdump command + # target information + - --namespace=${NAMESPACE:=default} + - --app-binding=${TARGET_NAME:=} + # cleanup information + - --retention-keep-last=${RETENTION_KEEP_LAST:=0} + - --retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0} + - --retention-keep-daily=${RETENTION_KEEP_DAILY:=0} + - --retention-keep-weekly=${RETENTION_KEEP_WEEKLY:=0} + - --retention-keep-monthly=${RETENTION_KEEP_MONTHLY:=0} + - --retention-keep-yearly=${RETENTION_KEEP_YEARLY:=0} + - --retention-keep-tags=${RETENTION_KEEP_TAGS:=} + - --retention-prune=${RETENTION_PRUNE:=false} + - --retention-dry-run=${RETENTION_DRY_RUN:=false} + # output & metric information + - --output-dir=${outputDir:=} + - --metrics-enabled={{ .Values.metrics.enabled }} + - --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=} + {{- if .Values.metrics.labels }} + - --metrics-labels={{ .Values.metrics.labels | quote }} + {{- end }} + volumeMounts: + - name: ${secretVolume} + mountPath: /etc/repository/secret diff --git a/chart/postgres-stash/templates/pg-backup-task.yaml b/chart/postgres-stash/templates/pg-backup-task.yaml new file mode 100644 index 000000000..f2c94004c --- /dev/null +++ b/chart/postgres-stash/templates/pg-backup-task.yaml @@ -0,0 +1,22 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: pg-backup + labels: + {{- include "postgres-stash.labels" . | nindent 4 }} +spec: + steps: + - name: pg-backup + params: + - name: outputDir + value: /tmp/output + - name: secretVolume + value: secret-volume + - name: update-status + params: + - name: outputDir + value: /tmp/output + volumes: + - name: secret-volume + secret: + secretName: ${REPOSITORY_SECRET_NAME} diff --git a/chart/postgres-stash/templates/pg-restore-function.yaml b/chart/postgres-stash/templates/pg-restore-function.yaml new file mode 100644 index 000000000..2c5d3339b --- /dev/null +++ b/chart/postgres-stash/templates/pg-restore-function.yaml @@ -0,0 +1,36 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: pg-restore + labels: + {{- include "postgres-stash.labels" . | nindent 4 }} +spec: + image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{ .Values.docker.tag }} + args: + - restore-pg + # setup information + - --provider=${REPOSITORY_PROVIDER:=} + - --bucket=${REPOSITORY_BUCKET:=} + - --endpoint=${REPOSITORY_ENDPOINT:=} + - --rest-server-url=${REPOSITORY_URL:=} + - --path=${REPOSITORY_PREFIX:=} + - --secret-dir=/etc/repository/secret + - --scratch-dir=/tmp + - --enable-cache=${ENABLE_CACHE:=true} + - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit + - --hostname=${HOSTNAME:=} + - --pg-args=${pgArgs:={{ .Values.pgArgs }}} # optional arguments pass to pgdump command + # target information + - --namespace=${NAMESPACE:=default} + - --app-binding=${TARGET_NAME:=} + - --snapshot=${RESTORE_SNAPSHOTS:=} + # output & metric information + - --output-dir=${outputDir:=} + - --metrics-enabled={{ .Values.metrics.enabled }} + - --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=} + {{- if .Values.metrics.labels }} + - --metrics-labels={{ .Values.metrics.labels | quote }} + {{- end }} + volumeMounts: + - name: ${secretVolume} + mountPath: /etc/repository/secret diff --git a/chart/postgres-stash/templates/pg-restore-task.yaml b/chart/postgres-stash/templates/pg-restore-task.yaml new file mode 100644 index 000000000..2758eba11 --- /dev/null +++ b/chart/postgres-stash/templates/pg-restore-task.yaml @@ -0,0 +1,22 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Task +metadata: + name: pg-restore + labels: + {{- include "postgres-stash.labels" . | nindent 4 }} +spec: + steps: + - name: pg-restore + params: + - name: outputDir + value: /tmp/output + - name: secretVolume + value: secret-volume + - name: update-status + params: + - name: outputDir + value: /tmp/output + volumes: + - name: secret-volume + secret: + secretName: ${REPOSITORY_SECRET_NAME} diff --git a/chart/postgres-stash/templates/update-status-function.yaml b/chart/postgres-stash/templates/update-status-function.yaml new file mode 100644 index 000000000..e41d321b1 --- /dev/null +++ b/chart/postgres-stash/templates/update-status-function.yaml @@ -0,0 +1,16 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: Function +metadata: + name: update-status + labels: + {{- include "postgres-stash.labels" . | nindent 4 }} +spec: + image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{ .Values.docker.tag }} + args: + - update-status + - --namespace=${NAMESPACE:=default} + - --repository=${REPOSITORY_NAME:=} + - --backup-session=${BACKUP_SESSION:=} + - --restore-session=${RESTORE_SESSION:=} + - --output-dir=${outputDir:=} + - --enable-status-subresource=${ENABLE_STATUS_SUBRESOURCE:=false} diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml new file mode 100644 index 000000000..b3bf521f8 --- /dev/null +++ b/chart/postgres-stash/values.yaml @@ -0,0 +1,15 @@ +# Default values for postgres-stash. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +docker: + registry: appscode + image: postgres-stash + tag: 9.6 + +# optional argument to send pgdump or psql command +pgArgs: "" + +# default values for prometheus metrics +metrics: + enabled: true + labels: [] From bd4f1a81d4e187e805ea33838664433c8890ca05 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Fri, 31 May 2019 16:52:35 +0600 Subject: [PATCH 02/25] wip: add PosgreSQL backup doc --- docs/examples/backup/postgres.yaml | 16 +++++ docs/postgres.md | 112 +++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 docs/examples/backup/postgres.yaml create mode 100644 docs/postgres.md diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml new file mode 100644 index 000000000..1fd287626 --- /dev/null +++ b/docs/examples/backup/postgres.yaml @@ -0,0 +1,16 @@ +apiVersion: kubedb.com/v1alpha1 +kind: Postgres +metadata: + name: sample-postgres + namespace: demo +spec: + version: "9.6-v4" + storageType: Durable + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + terminationPolicy: Delete diff --git a/docs/postgres.md b/docs/postgres.md new file mode 100644 index 000000000..6d1454b45 --- /dev/null +++ b/docs/postgres.md @@ -0,0 +1,112 @@ + +# Backup and Restore PostgreSQL database using Stash + +Stash supports backup and restore PostgreSQL database. This guide will show you how you can backup/restore your PostgreSQL database with Stash. + +## Before You Begin + +- At first, you need to have a Kubernetes cluster, and the `kubectl` command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube. + +- Install Stash in your cluster following the steps [here](https://appscode.com/products/stash/0.8.3/setup/install/). + +- Install [KubeDB](https://kubedb.com)(`Optional`) in your cluster following the steps [here](https://kubedb.com/docs/0.12.0/setup/install/). + +- If you are not familiar with how Stash backup and restore databases, please check following guides: + - [How Stash backup databases](https://appscode.com/products/stash/0.8.3/guides/databases/backup/). + - [How Stash restore databases from a backup](https://appscode.com/products/stash/0.8.3/guides/databases/restore/). + +You have to be familiar with following custom resources: + +- [AppBinding](https://appscode.com/products/stash/0.8.3/concepts/crds/appbinding/) +- [Function](https://appscode.com/products/stash/0.8.3/concepts/crds/function/) +- [Task](https://appscode.com/products/stash/0.8.3/concepts/crds/task/) +- [BackupConfiguration](https://appscode.com/products/stash/0.8.3/concepts/crds/backupconfiguration/) +- [RestoreSession](https://appscode.com/products/stash/0.8.3/concepts/crds/restoresession/) + +To keep things isolated, we are going to use a separate namespace called `demo` throughout this tutorial. Create `demo` namespace if you haven't created yet. + +```console +$ kubectl create ns demo +namespace/demo created +``` + +>Note: YAML files used in this tutorial are stored [here](https://github.com/stashed/postgres/examples/). + +## Install Postgres plugin for Stash + +At first, we have to install Postgres plugin `postgres-stash` for Stash. This plugin creates necessary `Function` and `Task` definition which is used by Stash to backup/restore PostgreSQL database. We are going to use [Helm](https://helm.sh/) to install `postgres-stash` chart. + +Let's install `postgres-stash` chart, + +```console +$ helm repo add appscode https://charts.appscode.com/stable/ +$ helm repo update +$ helm install appscode/postgres-stash --name postgres-stash +``` + +Once installed, this will create `pg-backup` and `pg-recovery` Function. Verify that the Functions has been created successfully by, + +```console +$ kubectl get function +NAME AGE +pg-backup 3h7m +pg-restore 3h7m +update-status 3h7m +``` + +This will also create `pg-backup` and `pg-restore` Task. Verify that they have been created successfully by, + +```console +$ kubectl get task +NAME AGE +pg-backup 3h9m +pg-restore 3h9m +``` + +Now, Stash is ready to backup PostgreSQL database. + +## Backup PostgreSQL + +This section will demonstrate how to backup PostgreSQL databse. We are going to use [KubeDB](https://kubedb.com) to deploy a sample database. You can deploy your database using any methond you want. We are using `KubeDB` because it automates some tasks that you have to do manually otherwise. + +### Deploy Sample PosgreSQL Database + +Let's deploy a sample PostgreSQL database and inset some data into it. + +**Create Postgres crd:** + +Below is the YAML of a sample Postgres crd that we are going to create for this tutorial: + +```yaml +apiVersion: kubedb.com/v1alpha1 +kind: Postgres +metadata: + name: sample-postgres + namespace: demo +spec: + version: "9.6-v4" + storageType: Durable + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + terminationPolicy: Delete +``` + +Create the above Postgres crd, + +```console +$ kubectl apply -f ./docs/examples/backup/postgres.yaml +postgres.kubedb.com/sample-postgres created +``` + +KubeDB will deploy a PostgreSQL database according to above specification. It will also create necessary secrets, services to access the database. + +### Prepare Backend + +## Restore PostgreSQL + +## Cleanup \ No newline at end of file From 3132c75049864a6fabeffb5c5f65f0dea8b20324 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 12 Jun 2019 11:11:47 +0600 Subject: [PATCH 03/25] added all --- Makefile | 4 +- chart/postgres-stash/Chart.yaml | 4 +- chart/postgres-stash/values.yaml | 3 +- docs/examples/backup/appbinding.yaml | 33 +++ docs/examples/backup/backupconfiguration.yaml | 19 ++ docs/examples/backup/minimal_appbinding.yaml | 11 + docs/examples/backup/postgres.yaml | 2 +- docs/examples/backup/repository.yaml | 11 + docs/examples/restore/restored-postgres.yaml | 16 ++ docs/examples/restore/restoresession.yaml | 17 ++ docs/postgres.md | 246 +++++++++++++++++- 11 files changed, 354 insertions(+), 12 deletions(-) create mode 100644 docs/examples/backup/appbinding.yaml create mode 100644 docs/examples/backup/backupconfiguration.yaml create mode 100644 docs/examples/backup/minimal_appbinding.yaml create mode 100644 docs/examples/backup/repository.yaml create mode 100644 docs/examples/restore/restored-postgres.yaml create mode 100644 docs/examples/restore/restoresession.yaml diff --git a/Makefile b/Makefile index bbe588c47..0542dd085 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= postgres:9.6-alpine -BASEIMAGE_DBG ?= postgres:9.6 +BASEIMAGE_PROD ?= postgres:11.2-alpine +BASEIMAGE_DBG ?= postgres:11.2 IMAGE := $(REGISTRY)/$(BIN) VERSION_PROD := $(VERSION) diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 5c71508db..3fbaf3744 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'Postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash' name: postgres-stash -version: 9.6 -appVersion: 9.6 +version: 11.2 +appVersion: 11.2 home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index b3bf521f8..99ce0aa84 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -4,8 +4,7 @@ docker: registry: appscode image: postgres-stash - tag: 9.6 - + tag: 11.2 # optional argument to send pgdump or psql command pgArgs: "" diff --git a/docs/examples/backup/appbinding.yaml b/docs/examples/backup/appbinding.yaml new file mode 100644 index 000000000..c0d56fb2d --- /dev/null +++ b/docs/examples/backup/appbinding.yaml @@ -0,0 +1,33 @@ +apiVersion: appcatalog.appscode.com/v1alpha1 +kind: AppBinding +metadata: +... + name: sample-postgres + namespace: demo + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: sample-postgres + app.kubernetes.io/managed-by: kubedb.com + app.kubernetes.io/name: postgres + app.kubernetes.io/version: "11.2" + kubedb.com/kind: Postgres + kubedb.com/name: sample-postgres +... +spec: + clientConfig: + service: + name: sample-postgres + path: / + port: 5432 + query: sslmode=disable + scheme: postgresql + secret: + name: sample-postgres-auth + secretTransforms: + - renameKey: + from: POSTGRES_USER + to: username + - renameKey: + from: POSTGRES_PASSWORD + to: password + type: kubedb.com/postgres \ No newline at end of file diff --git a/docs/examples/backup/backupconfiguration.yaml b/docs/examples/backup/backupconfiguration.yaml new file mode 100644 index 000000000..db21ccad8 --- /dev/null +++ b/docs/examples/backup/backupconfiguration.yaml @@ -0,0 +1,19 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: BackupConfiguration +metadata: + name: sample-postgres-backup + namespace: demo +spec: + schedule: "* * * * *" + task: + name: pg-backup + repository: + name: gcs-repo + target: + ref: + apiVersion: appcatalog.appscode.com/v1alpha1 + kind: AppBinding + name: sample-postgres + retentionPolicy: + keepLast: 5 + prune: true diff --git a/docs/examples/backup/minimal_appbinding.yaml b/docs/examples/backup/minimal_appbinding.yaml new file mode 100644 index 000000000..bd21ab331 --- /dev/null +++ b/docs/examples/backup/minimal_appbinding.yaml @@ -0,0 +1,11 @@ +apiVersion: appcatalog.appscode.com/v1alpha1 +kind: AppBinding +metadata: + name: my-custom-appbinding + namespace: my-database-namespace +spec: + clientConfig: + service: + name: my-database-service + secret: + name: my-database-credentials-secret diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml index 1fd287626..a84a3e713 100644 --- a/docs/examples/backup/postgres.yaml +++ b/docs/examples/backup/postgres.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "9.6-v4" + version: "11.2" storageType: Durable storage: storageClassName: "standard" diff --git a/docs/examples/backup/repository.yaml b/docs/examples/backup/repository.yaml new file mode 100644 index 000000000..6a8e51503 --- /dev/null +++ b/docs/examples/backup/repository.yaml @@ -0,0 +1,11 @@ +apiVersion: stash.appscode.com/v1alpha1 +kind: Repository +metadata: + name: gcs-repo + namespace: demo +spec: + backend: + gcs: + bucket: appscode-qa + prefix: demo/postgres/sample-postgres + storageSecretName: gcs-secret diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml new file mode 100644 index 000000000..00d49f242 --- /dev/null +++ b/docs/examples/restore/restored-postgres.yaml @@ -0,0 +1,16 @@ +apiVersion: kubedb.com/v1alpha1 +kind: Postgres +metadata: + name: restored-postgres + namespace: demo +spec: + version: "11.2" + storageType: Durable + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + terminationPolicy: Delete diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml new file mode 100644 index 000000000..cb716424c --- /dev/null +++ b/docs/examples/restore/restoresession.yaml @@ -0,0 +1,17 @@ +apiVersion: stash.appscode.com/v1beta1 +kind: RestoreSession +metadata: + name: sample-postgres-restore + namespace: demo +spec: + task: + name: pg-restore + repository: + name: gcp-repo + target: + ref: + apiVersion: appcatalog.appscode.com/v1alpha1 + kind: AppBinding + name: restored-postgres + rules: + - snapshots: [latest] diff --git a/docs/postgres.md b/docs/postgres.md index 6d1454b45..34ecb12e3 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -73,7 +73,7 @@ This section will demonstrate how to backup PostgreSQL databse. We are going to Let's deploy a sample PostgreSQL database and inset some data into it. -**Create Postgres crd:** +**Create Postgres CRD:** Below is the YAML of a sample Postgres crd that we are going to create for this tutorial: @@ -84,7 +84,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "9.6-v4" + version: "11.2" storageType: Durable storage: storageClassName: "standard" @@ -96,17 +96,253 @@ spec: terminationPolicy: Delete ``` -Create the above Postgres crd, +Create the above `Postgres` crd, ```console $ kubectl apply -f ./docs/examples/backup/postgres.yaml postgres.kubedb.com/sample-postgres created ``` -KubeDB will deploy a PostgreSQL database according to above specification. It will also create necessary secrets, services to access the database. +KubeDB will deploy a PostgreSQL database according to the above specification. It will also create necessary secrets, services to access the database. + +Let's check if the database is ready to use, + +```console +$ kubectl get pg -n demo sample-postgres +NAME VERSION STATUS AGE +sample-postgres 11.2 Running 3m11s +``` + +The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using follwoing commands, + +```console +$ kubectl get secret -n demo -l=kubedb.com/name=sample-postgres +NAME TYPE DATA AGE +sample-postgres-auth Opaque 2 27h + +$ kubectl get service -n demo -l=kubedb.com/name=sample-postgres +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +sample-postgres ClusterIP 10.106.147.155 5432/TCP 22h +sample-postgres-replicas ClusterIP 10.96.231.122 5432/TCP 22h +``` + +Here, we have to use service `sample-postgres` and secret `sample-postgres-auth` to connect with the database. KubeDB creates an [AppBinding](https://appscode.com/products/stash/0.8.3/concepts/crds/appbinding/) crd that holds these necessary information to connect with the database. + +**Verify AppBinding:** + +Verify that the `AppBinding` has been created successfully using the following command, + +```console +$ kubectl get appbindings -n demo +NAME AGE +sample-postgres 20m +``` + +Let's check the YAML of the above `AppBinding`, + +```console +$ kubectl get appbindings -n demo sample-postgres -o yaml +``` + +```yaml +apiVersion: appcatalog.appscode.com/v1alpha1 +kind: AppBinding +metadata: +... + name: sample-postgres + namespace: demo + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: sample-postgres + app.kubernetes.io/managed-by: kubedb.com + app.kubernetes.io/name: postgres + app.kubernetes.io/version: "11.2" + kubedb.com/kind: Postgres + kubedb.com/name: sample-postgres +... +spec: + clientConfig: + service: + name: sample-postgres + path: / + port: 5432 + query: sslmode=disable + scheme: postgresql + secret: + name: sample-postgres-auth + secretTransforms: + - renameKey: + from: POSTGRES_USER + to: username + - renameKey: + from: POSTGRES_PASSWORD + to: password + type: kubedb.com/postgres +``` + +Stash uses the `AppBinding` crd to connect with the target database. It requires following two field to set in AppBinding's `Spec` section. + +- `spec.clientConfig.service.name` specifies the name of the service that connect to the database. +- `spec.secret` specifies name of the secret that holds necessary credentials to access the database. + +**Creating AppBinding Manually:** + +If you deploy PostgreSQL database without KubeDB, you have to create the AppBinding crd manually in the same namespace as the service and secret. + +The following YAML shows a minimal AppBinding specification that you have to create if you deploy PostgreSQL database without KubeDB. + +```yaml +apiVersion: appcatalog.appscode.com/v1alpha1 +kind: AppBinding +metadata: + name: my-custom-appbinding + namespace: my-database-namespace +spec: + clientConfig: + service: + name: my-database-service + secret: + name: my-database-credentials-secret +``` + +**Insert Sample Data:** + +Now, we will exec into the database pod and create some sample data. At first find out the database pod using the following command, + +```console +$ kubectl get pods -n demo --selector="kubedb.com/name=sample-postgres" +NAME READY STATUS RESTARTS AGE +sample-postgres-0 1/1 Running 0 8m58s +``` + +Now, let's exec into the pod and create a table, + +```console +$ kubectl exec -it -n demo sample-postgres-0 sh +# login as "postgres" superuser. +/ # psql -U postgres +psql (11.2) +Type "help" for help. + +# list available databases +postgres=# \l + List of databases + Name | Owner | Encoding | Collate | Ctype | Access privileges +-----------+----------+----------+------------+------------+----------------------- + postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | + template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + + | | | | | postgres=CTc/postgres + template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + + | | | | | postgres=CTc/postgres +(3 rows) + +# connect to "postgres" database +postgres=# \c postgres +You are now connected to database "postgres" as user "postgres". + +# create a table +postgres=# CREATE TABLE COMPANY( NAME TEXT NOT NULL, EMPLOYEE INT NOT NULL); +CREATE TABLE + +# list tables +postgres=# \d + List of relations + Schema | Name | Type | Owner +--------+---------+-------+---------- + public | company | table | postgres +(1 row) + +# quit from the database +postgres=# \q + +# exit from the pod +/ # exit +``` + +Now, we are ready to backup this sample database. ### Prepare Backend +**Create Storage Secret:** + +```console +$ echo -n 'changeit' > RESTIC_PASSWORD +$ echo -n '' > GOOGLE_PROJECT_ID +$ cat downloaded-sa-json.key > GOOGLE_SERVICE_ACCOUNT_JSON_KEY +$ kubectl create secret generic -n demo gcs-secret \ + --from-file=./RESTIC_PASSWORD \ + --from-file=./GOOGLE_PROJECT_ID \ + --from-file=./GOOGLE_SERVICE_ACCOUNT_JSON_KEY +secret/gcs-secret created +``` + +**Create Repository:** + +```yaml +apiVersion: stash.appscode.com/v1alpha1 +kind: Repository +metadata: + name: gcs-repo + namespace: demo +spec: + backend: + gcs: + bucket: appscode-qa + prefix: /demo/postgres/sample-postgres + storageSecretName: gcs-secret +``` + +```console +$ kubectl apply -f ./docs/examples/backup/repository.yaml +repository.stash.appscode.com/gcs-repo created +``` + +### Backup + +**Create BackupConfiguration:** + +```yaml +apiVersion: stash.appscode.com/v1beta1 +kind: BackupConfiguration +metadata: + name: sample-postgres-backup + namespace: demo +spec: + schedule: "*/5 * * * *" + task: + name: pg-backup + repository: + name: gcs-repo + target: + ref: + apiVersion: appcatalog.appscode.com/v1alpha1 + kind: AppBinding + name: sample-postgres + retentionPolicy: + keepLast: 5 + prune: true +``` + +```console +$ kubectl apply -f ./docs/examples/backup/backupconfiguration.yaml +backupconfiguration.stash.appscode.com/sample-postgres-backup created +``` + +**CronJob:** + +```console +$ kubectl get cronjob -n demo +NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE +sample-postgres-backup */5 * * * * False 0 61s +``` + +**BackupSession:** + +```console +``` + +**Verify Backup:** + ## Restore PostgreSQL -## Cleanup \ No newline at end of file +## Cleanup From 7a37df9a3c6dde275fd62a4589272343653ee493 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Thu, 13 Jun 2019 20:41:23 +0600 Subject: [PATCH 04/25] add example for restore process --- .../templates/update-status-function.yaml | 16 -- docs/examples/restore/restored-postgres.yaml | 5 + docs/examples/restore/restoresession.yaml | 4 +- docs/images/sample-postgres-backup.png | Bin 0 -> 49904 bytes docs/postgres.md | 163 ++++++++++++++++++ 5 files changed, 171 insertions(+), 17 deletions(-) delete mode 100644 chart/postgres-stash/templates/update-status-function.yaml create mode 100644 docs/images/sample-postgres-backup.png diff --git a/chart/postgres-stash/templates/update-status-function.yaml b/chart/postgres-stash/templates/update-status-function.yaml deleted file mode 100644 index e41d321b1..000000000 --- a/chart/postgres-stash/templates/update-status-function.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: stash.appscode.com/v1beta1 -kind: Function -metadata: - name: update-status - labels: - {{- include "postgres-stash.labels" . | nindent 4 }} -spec: - image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{ .Values.docker.tag }} - args: - - update-status - - --namespace=${NAMESPACE:=default} - - --repository=${REPOSITORY_NAME:=} - - --backup-session=${BACKUP_SESSION:=} - - --restore-session=${RESTORE_SESSION:=} - - --output-dir=${outputDir:=} - - --enable-status-subresource=${ENABLE_STATUS_SUBRESOURCE:=false} diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml index 00d49f242..d4f35ad9a 100644 --- a/docs/examples/restore/restored-postgres.yaml +++ b/docs/examples/restore/restored-postgres.yaml @@ -6,6 +6,8 @@ metadata: spec: version: "11.2" storageType: Durable + databaseSecret: + secretName: sample-postgres-auth # use same secret as original the database storage: storageClassName: "standard" accessModes: @@ -13,4 +15,7 @@ spec: resources: requests: storage: 1Gi + init: + stashRestoreSession: + name: sample-postgres-restore terminationPolicy: Delete diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml index cb716424c..996c27f25 100644 --- a/docs/examples/restore/restoresession.yaml +++ b/docs/examples/restore/restoresession.yaml @@ -3,11 +3,13 @@ kind: RestoreSession metadata: name: sample-postgres-restore namespace: demo + labels: + kubedb.com/kind: Postgres spec: task: name: pg-restore repository: - name: gcp-repo + name: gcs-repo target: ref: apiVersion: appcatalog.appscode.com/v1alpha1 diff --git a/docs/images/sample-postgres-backup.png b/docs/images/sample-postgres-backup.png new file mode 100644 index 0000000000000000000000000000000000000000..e194c5338c6e37a54aca29f5760c29313e577cb8 GIT binary patch literal 49904 zcmd43byQVRxGzdr2!eEjfPm71bSd54-CMdFL8U=JLEAHIgDm^y|&;VgTDTEY1su&U@; z_&bznq##;!X(_rMGhaVBi%x}ipY9f(Zi>sU+MM!oL|6Bp*6+gb1Ql$cTneT>%5eNtUd83qS!Np?| z@}1YsckI3HaS6P;Y>R+v)fHF8>W&qqAhYz6z}qTBSC~meBm;>(JU-G7E$);X4D^@o zU9935%9+?PCQj}{9}*6iusjdo!b4&aSEWj)m8);+{QSHgslw>=XM*Y2 zqM3s`w?)LE$v6*dSg(e`<KY-ZWHA@Gp_mkh4w6q<%+T-lPb$g`sJ~M%EtF3k=|}V zo4sP&@`JlQcf(aA0*T3*wyZeL@1@h22_H!y>u%n;V`%zfU>4T5U{uLvwYZY2JDbEc z9v*-;m-q3I=HQ$o4(fOLC@#n@UXH}>&O$|7^>&W#X)Kp#)zDCWZ6>X%59`LaRF9$2 z&wW;^O{Gofk%d^)c%#7U6sOs%rifFUpQ&MnDh~+PIg{<<}gU_GBUJ=iyTB4I7FmleFscY>8$)*4Z(owAtswZSp8hMaQ;Z+F1l=Ph$3_A z#M%s1?)OKY+au0$6gy4djV2g<4Nh3*gfo$*@aXBYD(pT0o74MXX=)2yO}X^OPQ*-M z)$uuVB}Qtfoes7%g?d=X8z+`276@sY)4DhmCDJ^pt2iI-(1?7<@tD}c$f1bQTT!iK zwP*MqYVcc;w5Fzl3dhjkp2?!DyryFcifw5R_h~Qd`j;a#gMk#tEb@`E<-2}r@uc37 znkA0*+Rz*eebwBK=PYwtK23JN`p~Rmf=Cm%#z&Nqr@eoCo)BU-?u&yL?gINndXyq7 z+T(SvhV77xRU(M^*-KsNc~uQ-pN*d-T&Bs=EfI3nP5$5=WIdHd$4YmBk{$KXy}e1T z{7iecdaNnZc_+5C>I07i&3o(m!uNIxz>SYnbvnV=W)uwc{PWGd({%_Zom63DWI(wtGhJoi6FXB&{R) z%M*c#0u%Rqwvq=sbDbb1w(!m`8r^sh{wOv4zHH{%lC?|DTz_L(aSGF%R&O{dDP@Nh z)`Q%Jx+|p;voO{edo~rb3clv!Y@vIfP2LjYuePi1PVR(FcBF8*u(-xWJme^1@250O z$L%;^=20(Hbw9`m=XCwZOh(>Q`SN0Jdf>iIYIMqbmfnXPY@Sv3VPBV(wRBeA*o$u4 z+i3S4*2Y^`Y%5i#&%UF{=qG`TUr=ZQ2XSyJQP-0Us>UJT>2G-s(PnQWq^JMwT=!wk z!Tm?eY(iPx#s}_aI?Y$E;^lO7Q*PNGz!HgxEwb@nA>-`q8(&44HPc~ZM@PPSQ;3e$ z_wdBtaZcJmwIx{u6DU}Xjxa}VJ44=kN zdS%y*r|Vg0Xx49SPUe0F(vGR`=tYEGcHM-RGg4qFk`r3Gu4RqIbE41h;w6yo3h=Gm zqp6pmANSGj4ksO0gt(XtJJ5h6X+?f3Q$lHaQ?sP=o{N8ADZ5pHV#iVW@*}2u$Hdxl zm4zFK6hK6G3Cjzk$4W~gF*qEU=9_~A&BcWLGKW|?1AnT|)C#0d6Tmg*_1M^Wen(6Q z33e3w$ok{%=;g^)TVO$z2j6H;o%^vmT|q7IZ$Mroqne_4(_v^qtF6<&!7A&?aNKMP z!FwexmXV)-J9R?7TlLq2GGebAxNTC|&;k1{No7wVLKitJu1CH^@N* zN+jQsGVLzsQ?VBwxTQDuyRYQyisw}uHY&Ht&8uGaE4ifv3U)BsL}8#gINnLDfh}1T zOnho;s^B{J_{|V}Qjl}0pms1dFDqqlH1jJNYQ4Oo&~Iw*Ejm^X0uEDxNcwiepb+Up zeL~f?+EIw#35JVt7v8+iHVaevECvy=+qu3x%gQ%S*SQGw(rG7^{Pq;wi(1#fE86~s z@fskxo3)(pZYPI!dDJ;b4Aj)yO_95{&ZctYu&z`(&MW)z(c%=F+xibnC9A#lRKsPt zB{(&wVu9&3)kYuOV>ZF-99@EK?2t+{S+`@}Ul1qm2k*Fr}d>D}q;m5=8)YQW%btjf+4IYB2o+l^iAC6 zK;t$u#5EqjnF_QJ%CGhFHn&$ph0m$!>U`LSI<7!jWfH)|#|(eh@Nsi?jkH;XT92o2 z9w#Zi1O7h*5L2Wu`MI91%YoT9DTnd!eGXQ=-D2?O&+ zPICOSw^0dMbIvARc!rq~$4`NGj~RZO^!|Zjhy?+-kgr{DhhKU90TnRz$ejluk1V)v zhVgv0H$HH{>iC#*^6qph>nFeuWfA8`4kpKO7G8I%_GScy&Pb9y-a4aAdJ@cC{`m6C z^kZbGrNOk`hr(cIsJ6zY&b9dSk#-OEXTM_s&d8;I>0~lRqzJO4R^8Cgp}jB35Jv%p zWdP;`l2itbD*F>)HZl7G#|Fm!G3d~W>HzRif@dNj2&#PTI+&PlrmMCUC)1FHa(CoN z%+u^K^|GC_4zLmgTuXq}{nmlpgSFccm3>J;J{Bz~9GY}wVO}&T(3Tw4YSS7(v;79O z-su#&cUK7;dtE84Cl5&I)dA}@`D>T!5#qU!2QLYr(;At>Sh%OwXWikR?Bm^_+ZXdAil%mvB&IMQc851PSUvh zKjUp~#*1~-H<+Fiba;#g34Bpm@X(X%>z)EYnb7Cn1_)HVDKEb9R^kG8CmT~Y#G(fY zikzd3i>uz{nDFPvht8%TiUDL?J;+4w=QU+}s6nT7@=k z-BQ}HkGO^K*B+Pw;C=MarFwz0n#@~44UvHD$lm2|Z11kmEI4v+Jva5K;s--M0m0Ct zOh%Pu^_#00a3kX>Emp5PqXk7Bj9U7GAZq!Q!AwEKGR-9w3)Y8?FF1>fe}m;D#b;*% zL=3`oC_uyxMd79dV_O2~U;(7b;>T%UK5RJJRoImWT1?k(Xy9u4Da%}>uHts@Llit>b-`QT(y-M^(+r?*k8GXvQ#9Pc{ynPtSPTF$fa!IW6#o zgoP%A6dX2)6g&Ff1L@P<@TLNV8Wum+0r-I@=sL5h9yeAXX?V|Z`}LgLArjXXv;BC$ zt3Id&xw_BBiLp37{DH3y^XRd zE5|BR#=DW<^vPQbzce-3oe?Lq@Jz;l1iwdT5fhs`5lSd;I~zcNE5MkQp9qRIVQS3{ z3#gQJbxtj;f)FB`-#YiEwWB3;=ceE0w{8$9ckYhCD0QuUjNIm8AEj_|R;uV~>HOS# zj;QVqXns7Ndbp+k>h|C}UskS5~(0NxoD1AhB+ z{XYxJX90f(b9sVKV6Dsjdb#93KM1tQ{gCbQ=3BfJVyq0*=ggHVIt7mz$m9M$#tD(i zRepf~cPbj`j}dYQSAP5PN@7KYE2+-RFV(EI@qArfZc)UjVqzN($H&LEn_Oj8!^0{C z?T3GtvA(8veRVZe^N6`1Bjb*r-))86-@-LybkU15sN5OekNx=Z;CSETzpvuc6BHDj z2DkT*jKt*b*Zm!vuO^p0z{|tq-;zSgL<{Wf>}+R)2;dtV-D4gGe`iOYoEsi4t6Q1Y zR$W!)z?l;Fw?vkNZ!9m5j@!O*R8UaRi-6PqxqEo%`Co~Fl{(sO-urVe5N@zY_TL}N zNG93|62rqig8}lNz1pz@YrMQ-tUO(~g)94UeuS!OR<3yyDL39M z!2CID)@0UJrYh}IX+kJ?oifHtB7ftbrf>fgFuV?2IZ2ZUIpwzxxut zMNh*V+xlDI>}O{5W90@$m)g%UudP(rZ*E?+V!UZnSv4o0K*hqsrSrp@Iv=|RIi+f5 z-`nc;mOqGix0y{!-k;DzFX)^nUYcBtLkD6Or{NG-ljOmOI)hvx;e0SbGww6T3YfSBo*D?|9 zZ@?kse^-@#MvTfzjI@XOm%u}uF<8u zBhP4ErTqG)uDFO))T*xRa@${^YI5mp(#XZMbK#Z69HEq-B2Tn$Jes8jh2jI6eqX<* zaJ*C6Ws{I~d6_bPrT+1wn7rS5%}siYK~GTA+g*$;%D9usIvgN3OV(A>xY=xn{Y$&r zN!#tPfuP56-bu<`ZC@rV3yhVxRW4Q>=f#s0y;V5gMN+Kw|8AoANNje=x=<;swioAz zU%Dy9t62Zlz3J_kU#i{%wBwci%UU*u&gwa*+C6FGj62CTdlzn`BjJ8C>IU#qc!2vS zer1?^FNt+)R@Z=qyM%K8IF^%#r!JaypwS*Do0S>F;$}2hAzu2t1>1lwq~SIbz3Ieu zV0C}3l%97#=JCyo>i*r9f~_fASJ%~Vb3y`6siFIHaGlg+bJJ}@+AzW8+rXMVzsmC|v-sNn3|Qk12BK^vieiN5zB^eF>Z%A_OqS!sAc zwwB8FwKnb#qEC-S^sM+wX-Igb6z)l*NoQDWWi<*1bgr$pzKkzo-L2wH=z2<<6vCRP#f7OW^A5YJ$$sJdyN%6wX(th!U&OVYFT9PyLY`V&*es=s zkW7oPL|>n}>_B~c6U}mMuAL>HW6f{OF1x+<=i`9n@kdU}*x6wqW1`$SXZQQeE%eje z?2142Zn$jMH{xzwsCAUxnwzNR*KaxR7%*?(_YH*B`cX&tUtlzjM0~mzWwQXma;NIf z51XNZXcsR&RjeUCyF`_*oM>-8;f^|3u3!j?Sns{^?Z>0+HPxPaq3~El#%0zp%!z$Y zpnHjiWrh<<=qQ*>Mc5c>46EIL^(NvFjom3CYnnDmahj2#oDXGfTQnka;Qj32+`S+n z9I2UM4xdv|n$S!NRAKM$xal92zUuZSQZ64JIYH*m<>L-}D0f8EBKie|1of#%NowkM z=&-UQyzO^QO{8z?Q zto5o==X(XcBs)RK4<4!`;bU74OsQ{dKAUyqH$%G11}PT4AHv2-@rh*CjWD#hIAa;( z2_MV*^-L7EpIM&-1cR=n*Plvq7j;~B$wkRhF;b`CNg@U6OBc7&!5?Ge_H6Os-c7K~ zc-mefOdne|i5em+L*?biP>MUeA0=<*=JFsDIij2~X0muhx(AJloh9X2Ou{v>bZ>tz zGPQNS7jFl1X9&HU7oS)=P8=J#Y7@)wXVrM}M1Mao9Ob_H@3m4P5j10D(l$OQ*c5lo zGJk?8ea*{o`Akw1=_GA+lQMPdH}_Q7j?!(>?l9;HjWV`@t3m#ah>eS>Rsdzwt5FBV z__)4W>xXCOrSDyGiYvT75vG4Y%30_kb8t29G@_K?JWs9Oa20s}z}@MTVsXWWqxvOH zz-o$lTgAhgi1n`FOQ_@hswUh>@}-f}UM38-M!`wFo0HoBQU zX+}>CgXJ+Z!CK9aym{v}C_j{hdpI}~-D4($S9rNnDOj=)iUJDBo2o8nba0+Wma0iK>B^54AJvu4A_Ol~qe0T6f@yFDq z5-v72@|5<2?FYb26p%Pom6Tq+J{AyL&C}1Iqy1z|@k-C9S3Gzy@5>#P5|I#jd788u zb|PF-c`3b@q0(JjVJY(YBIXJtBe2h%FWWwS7P!7D$uqIY@MDLWE zj*>JJkbXW=Y)dZMi^LJ_XqjOaA8J)~q+@8oV5vfSxEia zsl-O^xwqBn)g`35zA`Ogb~XQtx*D&qle@JUCO5ZY`y)4tYr;00!Utwo=4I6t4Et!3>SxewroMtt(9Q7uS=Ogx$(--G?;msbyBp?b z|Hx}Tnea+Y4a*cV)Cgn9VN+8pf{##_I9O<5p++V?dF0EbPsBBhyUUI4>08aH`0*5C zW{;|TYN)DjDA~0)-nQxtCe;B`z-2*ffy-5b|v!*!_E*L@nv{TRiM&%=Dqh7aO^S6&Cz_0gox4seUSFowmwN7{H?EH;|x)hpUZu{WHerP<0pw<1X4;VO07BR2!Lc2o6 z#4KMhT|l(w0pSVkdv_}%C-d7EIc zj>SvZrhhfF5AIigzIapTAu4Lkhim5YUIx95Hg0@wN=A$Akd)xJAI5?CkiG$@h&jxr zsTEChwsCD$4|0h!r-!;A_9+qfn5H^5qU-+T+S#N(?=4|>D<+>}6ttPw&7nopaSrMm z$A+ei#wq|}MvmXX&SKBiFa5PB!L_)eg-KNSd`AIt-S%3ul{u{Y+r&h8V2>BCozYbh zZ=x<)svx06o=|8JAWQ!>iW7dG_@BMrI5Zi=>F?xGMSvk{R#i0^Q! zu9T?tmpCyKEv?B850Ua7D_}_5)}Cdp7-;aTXkx92m^=`%7S0#P;D4Y?! z4`T>R8|NK`ZS)V&dpkL}3bE$(ns)X!PU+j%UKFn(3wOjT`KR8PKBpcY;v^BFe0!wa zG0*R6b&wiGQ2O@LZDw}%MS@&Ts{xnaJuwL!VyBzf&g?fL52-^H6{wk6s-wHSN!(uC zE+_WUQPT)^_R2jG;{5#OcMY<@=d&*!)TF!Y=|gf(Oe56&r}!ATXMZs?%fG{CE;0P^!+1lpt=zjMPTeQ%Jr3= z!>(lpW!u)Au8ej7)Jvyps%`#2q`>w>hg6ZGp%B;I+v}6-(?oYe;iha)!O$G+mv7}H zf{yC>Y6MPRR3GRo(5CJ%TbGeoL2fa`14um1qccA=pi`w8VC=spNa>Gw^Kiuy`Z7jYdT$uT za@$##-7*Dl>k?GlZ1OUPXqISrAh&(1${fY>nb&{p1*jmlN#s#Yed2y`T2{_!_Awft zQFhX;By7K)E}Kpk=?vEf8(;bu;&5dqUlceTT*(>l2RVD<>N!>CjT? zP&ujsFB(792S)AbUYT<}rqoYc#|t(_EJs(!xno90uRX-*V+8m&d=`$`^sihf@A6g< zJIZ5=bx1rWM_*hKzzL#Dav#c39J!;WZu$_PyvE#|7gFfdzX?!k zzc>zDCV^I2e_}j4KkVESNSX0T$`a(~crh9}13k~i56qRIZ-KVs@*`J-V?bquo+KzFuP@7~jZX@X4^w`QTK=DwRqaUN1 zF(i7rKUh5Ra5p_Us%vwJ!WahcprLWLMdqH4;xU}=dF00>NQ7gy*r(_mzd0QmDyaW# z;JJ}4mj@P?!8l}OU;Ei}Q`iMgw|)f1<_3mu{md9mR9kAw!uj_nKYVg|&Ma9H8T6~H zGw64CIIMh-77dpVmP%lF5vO!jB_AW!1FwvZOvYW08+`9XZMP@sOU75;@bp{+9*FI3 z+#PFh){f*%et>yQm!WN{3V2vSD|f2V$?EI5w}r%F{Hv(DrJXb7lp!XsLbmb!V$eEG z{0QKevESUI6V#pgag~)(rQ~F2Tqll5Ol8oe!lTUHG%$V^Zjj8C7FUfY;Nywdz6Ekn}UDy}hKTFLx^J0VhDOhV$73ZG@|l66^+ zoPq}CDA6x3&kjyg7NqIh(W-9=34|C8uG=z^v|MdsK3)tXqFY(U=d3%hteti`6%h6*VKG54ylwvgjIdNtG=b)rT^gNanOi?>wbys z;V_RY_{MI)p4M$g<+EMJjTMpsy|;P z?d7cBwx6$0X3?)PdP%~X%fB;}E{TSYZXKG*l?_!?DieMl6u*o@oux=WmGY*S*DN#Z zbA9eRWXE3_ycE6(GJ0w#37Jw$Ch2SmrJYiWG#ot`H=HTBR(@i#8h3_9OhXR1OBn?N zN98z_LoJ_n#2aa%L>K=Od%8`}TjOdpSRpi>? z&(bo}Q3+Bw>?%da_v({i1fM7<<$Y=rK4okDpb>c1DM!!DfzI)mT`=P44Eg0z(qQi- zcI!{^=sMvpE?IL82FDj@W*3q;goG_fejM7wzcMm*A+P!pynjwg40QcE)$zW9eyJ#h zIUoq8`;EuYM*=Rn+!MhhWIf|or(}tzv5PA^tvyk9hPbO{XHx-9U7e$M)KG>_$Wph! zcevVT?J{|NIzRCJbw#lM_U~fM8%KX}dP=ttw9jH8acdtidQl%Ve% zrmM;n`kc2{L5i04IWCs!o#+?RPtDpUd|N{$@06;lph?S7)6%{_Lcx;5RtE4$-bW2q z&aWy*9ZLKH@vDd$2^uzq7+vOPl4vm%8IsUa^u0YSDr&y>qm#uvL1JEF9Num(c|+Hq z(!&?9C#4=7hdiO8y?YxVrUL1R-ZG}9W{7NECvK&m(Aj5?+*EWic^G;V`ZVk3r=-P! zcb!ByBh-_z@vQ|PP`(K!t4J|Dx4d~uoB8SM%S1emvtTitm`~kXT6YJ(en(<(eY9%4|<|cFz*N zG4-NjDf=?@FQI-|mJ3gFDch;~!{$>vIZmlR*bbR>{I|jGoFtjNlEylJ^4|x`OJ%t- ze@6__oBgkSc>mE-`0v{t5>#q`I}kb%|J4=<1bs@xWy$&Q|Gf``=qg<7)b8fl&W3z7 zE7o#wbWAHNE6Y#(J6&p5M3gXer8+v>hXn)%mb~j9I z{ZpOycw>EMlwrC|Q(RoUwWDJsSCh343MJ-qd1h&88M$(Ky4x`}7Q50D=X}`54cpyS zOci=-$Y>g{Sv*7|i5NLk<98~K>f?h8T3=A;Hc#7tPkouE&TTrnCUS%mHuZ{k~ zjS@I`(AL%_Z;)F#=N0aIeX+Q{-j%JKu2o`&R!~r2W^T?qK3U~RW7-kf*3l8XGh2H& zD2f#w7dNr&`^OzJOu-UK=6dqgD=Z6l8g6|-<4)4VgqqU#jH+_R3B9qL0MH z#3VZ>2W4TV+IhyYgM4{)^`M)vaBr)0pybWa51nl$Mn>4UuKh~sfRO3=!3vX3S%}{i zj8YDC;f6NLJP$3FmX?Tk9G+N@=TWh+M7FlJ>TLR)OhRT{C-gBW1mY1l*BuSZ+Dw)N z5_4GSE!X~ay6s8x2sHBHo```4=7u%f0)qYh{iChP7@!yw2cXzPU^gYkE%yp)clbKI zLPJBvBqdRcOxhj_U2buFWzue58%j?s?|+Ya|Lo>+*K;LSlML+hyi??|t`Zg=?&$6g zKZmEn5qfR7z1~G86804U*71~=H(_n<4FQwZt2h>Ytp;B~JG+Y0CrnHq!KXr3d!jq_ zmv$NjdR?HS+S%FZkfds6_H=P^G1BekxX{mhzW(hN2-8je_fZ#CS0#Xf&HLR7HZ?VA zF~K1sCwqGfZG?tT!DtQF+xAseRXi05T(;j#1!KBeFOD~>kH>W#-702Dd3~>V5O@5_ z$#JTq`y&r>-CRu($s-QEeyZtM07ednBq<$7o`1~Fy!`59voDXqr+{uoZZzbwRm)Xem>&~Pqz78glunbUw?C9{qW(#s>6PM z>+Qn`?m45b&$LKaaN*lUi11|s%{!DCug!dy?WtHrq4PWM$obtIW?d(EQJ(#7HkQA= zIc*>Ysx>w?j_ z>Njh)1i7mv!Um(k@2_1pMnmVXR=K}?`J!at>&VUbC%$A{*W^8(nqHQH2*;rpYUP)v zqU&ELHu!p2dkaoI+trR)f}MBs>MVAmXGL-Lt*i9bWYCB$UL40 zPxWivY)kaB6jLpB=b+^uEE;^Tkve;NO!t@C%q%SUZV&=d%~BZpDH}(3>bIS zJUkqoQ6q2Ra6lLWVuHLK&0ob0n7ek|)jgfM-Kx;@5C_#=azs=!6qT8D+u=*OcOmjKS$M-2dgdD$=ya7)Yo(FivjUsaD`SWK=F^dy89B<+&PK`TX8Hz**111kuny!-9Qy zpZ?{`vLPcumo+8u&ZsdfTbBl4w>-SOV><9~*7`RNet%>;?5OX?P#5o*ra97EmCWaA z0>)(0DniN~3!AjD82TZurlvOPt=Bc8C@e27eiv*85WYPhFoQr!t;TXJ3OU@iv{F2l z(C8FXe zz(R~>svLWh`3Zs3*SKy|eN^^{p2=Za=8&THNTNQLj|to!)5!`YtkCb|2J zG1%o%ezG$={S9b5A|j$3M6ec(+%cGtTa7*~)w$N%)%As|YOgGj6sA(75WP2F7Mb-ba|Q)xGA z1wCI)%uh*48DCg1+Qd~9FlJ_8$SLnH(67x)mxw6w^7PbhX=%x~uiFnAo1KMfc$bux z<|DL{|Ni}Z4PZE%%#|}HAY0u|FPD2=Zdc}m7nWaKTO3Z5s|4H-oI8RbF?S^KcmP|aJeKxd27t#*7zIB+u~2D!~- z-5gR~>Gh#aJS7a!A9idI*6u&?r@gZIcuQ+L|GED9M0d_>lewg%)1-@YylMs;~uJ@_sLU$8-(6olP?w3ocR$<^5k>jj zcV?`%|DgOrH8dzj_*{=Mypop5yM%D}rh@x@J&Qo`*0ZlUnU(06>}7;mF?AeIe>)%H)k+%x@UqXzfJ2v zlFrks{v3)+e{j&l>bx=f%ffbg)b))Nu%`rIK0jZUw&+jP*a35$dwZ&H;CJmxO+$kK zAUelqweGtXAQ9zz$${xcM@q#G%BrcUh)?+)Y6}W~G|Xg?_Aci(zY)5+xreh2ujL$@^0h(G*_SDJmnu3o)6{-jD1??_@NLpZjgDfaqChJ zV|&xHt+1&Bw1J9@TM%dn2^kr=wY~iS0F4(Wtq&;tt{hW*FDykwML}>70FvlU;0UG= z^x6Y)J0?2%JwVD0S1YX5Hy4{-{r!jyQb+3}!ReAw!K$?kJ#uT)fUQ14@! zjbf~r{w?7<`9!W_pzxfW93pNzGU4lW#q*;P#q+Df0ndx|EaWo)tolF>ArkW8 z3C1K}iq$kQ26z{+*DyZ zy?1WJN^HumpplJ$z^aw1Geo^EW4zczAe4KIcxD6arH4{$$U+ruztV zqpq%w$kw*gTr)E>XX}c7-L{pp5{{0J`I{GA^r=N|+d2#k3|0H>q~|NFexXf9MlC^) zd;mgKQ&%sB3{YGgt+%Ku3I-0nSq5<)VLAxpkflgz(HsBT$jB&H55mvQ&20yw@SN|Z zEdwJXuh-EtX=&+5mb`yE%9!-3J{=r5-5kU<>;cpYTUlvC2t?4!CI6b7$Kf6Dvc1Il zt016_muD&0AoZ>S6mtKGuy86+Xq~ogxfW9$fOs}jWoU|uiaS*>%pd9L$kXyEnuc#< zTY|B0$;f&~f2pE9dSqK-i-9CF^VD$55 z`IwdELc7=pOA>_qDo>pameoF~jA4pu2&#l1ueS7-`qbZ&Avqfgw-@=QTtOWDd>ySH zE7DWK<`PlQuKj1%r(67w2c~OC=nDDeL%Nbb(xQfhV=i$sMpZWBzXLPka9C*6DLmet zPX(cVVR^ar5%)|Z;2e;7T-F{-q(>V-y^4LWy&}nYn*r8Icwu_4Cyo_9!#mAONI<|2 z?Dgg-OBi9d9VZ0gfk5TXEswZI`Q|F;ePykz7y#`A3nVl!0^heLON00J902?GZp@07 zn>#LsUa`a(uF!bWCMY0qC1aT4#YBK^=y%OYuaNXzGKwOig51jR{=1nOy?dBsoh9Zy zYx51l1A?byu=WVpn5H4^vu7buLKoR{`{Q}qq7DvhjG6_A$QaqZ0B~kkclXjtoT0_e zOm#+P=I59gRqJW{`tzW%Tunp-EHdlDK~$9AIIYQg8ZI^%cj^umzB21dNK2#XR@fjL zff`FLi6?r((2qQ(OU%k@1HbyK{I9&cWdQ65-(DOwjg_xo+Uz#m3W0i{?&_dN01TU_ zQ=T(k-r3bf1tMGrg?C=p=~i(E1*~G)4)JB}hICh}(vCbBi_!vQc7$Vt1%v>!k5ptc z$&OfN7(QbaERr8ovC{drn-%gP?`5Pb(H`O8$Lj2zy8Sw>X{cmu`w72jZ)s_1&(6+9z4}1e4A5wIcQ?@slRJLb zn}*c@kxdqx-shh4pg{ssS_BmzXiA0ygn~mt(#<{ZBRWx_zkhgW3IG}snED>5;#KtY zgSgSunC!e+Ahcd;oNW`(Og1-}~;zx&Qp0Rb{YL&HdN{&rB+5p&xm zrK`9uG$I3c%^a^1L#hMSFyad^8N=n)nwbj8GC<=1-bnb{MummtxRN7XU0o4zTHzrf zVw7Ygnd3*nx}BO$GGi#6f72^pUm?gq%1UOUoe8LgA}3^JWDo@i)a%#;1UU~cFB7gr z@@YFz94Fe>CjhHQeoRW*1H5|xaHd#|pu$tUy{VA7X?%}LJ{$h%9x5*{FF?I}4Y!vK zU%q}F*5Lwx8`w{g788K#hoEdXa7bjWKl>m_;duwd0s%omP=b=Et5?h$mQMB}xB^h| zlTFn88kqk1yTlwF1Uew~1sJRa6d3(kslGB&QV$SS?IC;s!LuaV)r2lBnE-8&*#3bN zl4*~s=?^V3(_bpf^R7ZiwrLtt3P1l=@+m%G@mucmT>BD7T z7c(!{RP*tUM?ilr+C?Z{l`$4(BrnCWlBLC@GDh8&q3fd-TZ@;xV~TbcP078V3#@vS*%VthOiCZ$j>fcS{I1c*o{+%T&B zYD2RjXQJ&;#MV9xYF(IIT3SlOGlmB=vN4vMz-^zBp6g;{^aR*pdisT?j!riK;Y~np z28;oKy8Su__2%~lj?V$m(U-W1)a}X1$%L@5he#HE-`eskO{ehoN;(D3k z@KGGQ`g02k&t>d94My*itwpf58l$*PV6C9qB@@P?6e25%0L-v6{XPFCM>~i0U2W6; z6hT=)Mv(~vSd@^jTdAU^77!Jsm@iWRo#r1jnnqw&zA(lVH3T^XJ)H|5dQ&$XY^8qf z?eWP_tqZ`tNS5la48PxIeBq}iO({PydrgZhRL<&2FRYn4HyL_Aoqx;=`u%tFqzQT~ zfkS>j=`_|?whZ^{&9mz+c8Xg|LJNhB?##llc<2(*t#7d~i)K}+D=4HV0T9Tabig9x zc_k$kLSqC3oD@OIt)io|K{T+syE~8`B_souZ@taR&tE(D0;s78lKQs&blz_OEOC?h z^z;-CXbIxe8D~YPIiOvxP8)7lKP7aIGFR^-3JBK0Wh2z@&2spq@*MwcC!Z{D*?2#w7orRBy}I4 z;f(L!kz%^;Gy)qUPpby)B!RO9|0}?mz%Monv%F7t&K}R8%a{Nd9@tPF08Ki%wA~H)_|dHI8z=Bs zWi_?d9Q9n_pVoUsqQRKv0C$1t#&zZq-q|T7baQ43To^|_@#;VJ0!Vmz^4iae^D z2ynC0mG)UcgaGk5ULQ{!u4koIba@O0y&OCFx);}Q6?nWkfm$J*4$u=or#=T=^mSlg z)tA`VMHtLKF;N#9Hie)V0C&XWwnb!7ngDF-_Je*rBO{}?DEO*x)j7S=|xu>5W> z=fMLupy#M*;CUAUflEyPQ@k6k%lhz71kod3pbA0?kRp+Q2OBQELY-C44@Jcn`%Y8O zEtt+JoIUZmG51U+W1tTC*xRT+dgqh7n2Q@21A;^!Q{&JBIqB$0<_2Oc-CgN!R%{N! z8HrysCQeJ9A@9wI&YrgzD((rBVhxs-zSmqTY#JjDI^r7c8i?hG`}Ab79>W8F&7Svl z!!j~b5i!{>eri@(5c;{sWxW{yCp=9bztvXR=J3T#jSh#iSSz>Iw8Bw zZ?>(it+l~4)Yq?Hp9g8&zjtrA&`>y2F;xM;OlF-jHeoCsa3G%^Q40cExe@dwere>B z09#^?b$%XcJ6%x>N(&oXTL4dBh{0zC?bSqpL4sQHAtol~OS_r)FJJJU>>6AF(Bc8= zieE};D560aR8O9~1J>qTt0=I42hrF7M^C`oN;@y})pIp`uJ$`X1=J(JcxVVk)F!^E ze69?D*QDj-9ILwqyqq04wZdgX1kyO<`r;TcitL~u@o6bS5B~%11d7;+9ww}>(tV^5 zyvVGuAN-CC3OA-Ms=}T(FLB7p_05Ky=tJt>7%eP2+uXX(mSFyE=C%HinZe!I-Sulp zQ9_cGlmy2}?1!|acg1+C9k{sAxgqE->VHpC%^1t*1>C$1nVgTH5c~!J?=Yy2eM*() zax2K{nk8jTJkzrjwS)hXA102p6p`LE;EswnyAV&JNN_9~Tuy}y<&%ya?Cc0&`hMl~ zVo&!kQ**BRtBxMguR|1EA3uH^exrcMdtzccDzqe#iP6zbz>f}~{R>`K*Vp!E7?#qO zJOzKcSDneZVuEP^voC|E+ve(dO4t6*w{tdEY#;#C37-IEw79mWmA8F;eJ$(6^Y@L< z;WFlKGt0|n2u`FwnZIMXD@K;4KsR&oU)R&UKqVo*6C71Z6Adl_;eYr|f!>?_?$8p< z#US5A-G)5TzvrsDvPKPtP`t?hu(RNQI2isq3YZJ8_vzCbrhmz}`TxrEepe{W56zjpAo*u+)C8&w zrLdc~YxzO2zg8h-{PI5@V3KJ0*T8Nykum4l;hYFsu=;0JA$XZ;;e+1NZf;yacYvpe zb$zxHb@+Iz=x~m-KOiRDfWfU2Z@P^vLYfV0JoSEP0kjAKYDn28k?G$8fc_A z8~#2A^PNF|Np?z*EcBKH)FyiR`u3ZSJ9L@_dQ?I}DF8$qvab{$Js+slG(L}rit1=< zyX)$UWyV>nA- z-XL&=8~iH~J%ZOO5m4yc_Y?yMNtez2lHh;E7<~WlEQOAa0Xb&9z$>Yu_gU1}Gy#MK zcP76QOmqJZYOokUnSIsqE`;^l@+<~*QnhZ|4$jUn zP`rxUxkIfBuI6e0_;os1?n<13gQSbdpn(PaptUw#VapgXXqVgDD@VYhr!{VjkZ3IM zCAyAC@|Njo{`nFPNdFfvV>KL5o0)?-^`;0W#xiOiG@@dCah1A@AhxtiEmm|-07(^R z6>Xpb;0Xi_o5bgu(`nLBcLqNHW!NAD4n7Ki_kyULH9EybgaImdZ2u+))yub_0}9{| z4k@YkGz9uTsQVMB9@qYV6c3vyWU5e#QZ#9#qGThIG9(%`NCQopG#4V8Bx%wll%k|T zX_hq4Me{tTd7kUME}myU&wu@Y=ls5Bowd$d$69->z0n9y7NC>bHRF;4s~uJ*D3sQ7e79vrpZAidJHImK9uQc!Ptvxp~y*1E_$! zm$ur_9K*~w_3P&w6!<29YC^ZF-bSC|^g~t9Yx=?u1hcL|S?6I|;Z4q|_RnZ7HxV`& zrT+jsyK{Ta+X$z#qnd zi6*mhlc`@+nK6( z?emz6(RD$iq{z=aUK;!0)T(_vpZ`R@GcB5Gq z;GF?FG1``mMPZ7263_-!c{k5^oG0LBBR7c1%9=q$#dG&oog6_p% zH8IpX?A3SNRfkdYd%8Nb3ZmwH6&B?aFUgL>niVkVIGuWTi0YEj1ofp9Q|)ixzK!!7 zv!55j-<2hE3kki@F7}N>i)rWRO%{gZ;us|%sqpFNoDa}{z9=nCMaKQ}zTBE9m(hxG z58l4rzt=c&0w?w?CYkz7dt0wq>T?$^=%53!Lw7#dm|UK|7`tHH^d+vsF^7T-(g5j5 zlSt32Cd3QaK^M1!4Byde887SV>KMX5ogN$-ic*MW0u9vT$cycc$Jjd%o2AoTpZ%HXh8~2Kd z1>pml%un8uyK*JqsKxF3LlH6o-vH(imYv~$r``OqqE7IWG z!~xIV`uUy~c-}rBl7yFXT()yqS+WE;T>v>)U8X(pHiJpswtf34J-vfiynGV$Gqob~ z(?iABOZ||dV0(%jJt}~ux_ZqT7f^|y58o=ps$m@NapQo}Vbz*-qfm{Qf;P1qAOjqh z^Bnn{S&kB9EdWa6Hzq_VZhaIAUQ~Czo{;He-(}^`w|$J~umG%vQ+mPW) z+`VxfZlLbVBZkr->I+Isy9>NnALZ?#r#}nApbrBae$f5{2fTfJaVx}8nH+~NI?I{_VjcDz|q5t_2s~-C7*|Wf+e=pBn zx9j8C92^|#>gx%NKsPS~oUND;%q=Y~kS3v9Hy#DBx5m1BBxAP24VAYtMnxDj)!MHZ zLWr0~_N7o5?#JXv>x!?|B8K5er37|yo5`=0l>`}X7Hfa<<_#-9KR?k&#j0ls^lw;8 z#7TGW-j)BT8URow=>!v~_|rf;$ZgEdzR$0fhxRiYvJtZIBo;^4K;ksJuuzR+Xm;@@ z`Ncq6(K-A@Nm&g-g&_|sF9*D?KcD96r%#`n18l;VmHR7Xt;9n|7WX2nxD*diD}@xTPiJ)vLXzIrq~w--1!b@v%llMFo?h;!R!+ zT;rX)ck`N?_gGq5qHaJW^{uqj0}K9!mewhhV4Pl^nDOVP#T}Q$EPnmS2HK4CyT|rp zZB30YG&oq*k=N6XpdNF5R#o?W^X5%Tg&0IScyie-EleP~abu|5ZHRCOCGSgGT4z_+ zX#fpWr9Vr%(1mxYMJOaT?E^kAzUfLDI~qG^76Ke&)iREvJX4J87!UsZK#xZZLCQ

1m;}MiCt3mc6Q)n zPh@HnR4YdL=VF?N$0iK$kds_aHo8v4PDhNIq%K_8jD{8GLvDJjx|up7z8fcN=is1$ z+O-TD3+Tnh4J`px+wm`5#iEy3n%s`Qg7T}L(D?W57n|f6g^LRdH((Gvq@Jm&aWdxh z4eno=2Y+R9M|%W{my-wTeufpZGoz^KLo69msG00W|Nf|&a-$^=PYGvFaAf2`D43$6 zq8_z8t_|@lEiL6S4Mq2cr9c(Dg-2XG_`KhtfUF-6(pggY9PR09i;AdF&d;1#N6U4s zB)O@uuuzP9;ibF#Mqu$&hRNs-7{#ofp{#Zc4$6Q7nz-KB$i~W=qw21nVRN|EAOjHK zk7y;q*6IHKe%ug~j_(`xjyT}v+uXlv%>E92)rCZo_{ctHtj%|Xn7Z)>H!0JiV8L5^do4dqouPG-;%+Jkj-L~zU z^CkwWXliQeP88{z4T-l1QwbT$b_NDF4-eTWMuzcmE1b!8#n^V(p;yBi>3#FjP2lv> zT5iTjPD?9^XYMa{Ixf#S8`6Eo7GPcHbRSsh zYHuCPHthi0aF!bPi=nv@bzDxLv&166z1-9?nRrvOtx7DwxcO{Jk>Iaf`XKq}ZNF*m_J3Z;GTH=5-5UvdM6h zC=oZ2gQcK=kERk&Lwk8~Zl}i?EJ*^rVCk{(^Lt@&L93*$m+mOx`OU$o_T!$cmE~jl zwIA7z9SbClA#63N&?}*H^8BC>iz0fP9LMM~ zbc{yQMlxAJ+u<@HcBooyjd_HXNYl{o@7%a9LN-t*^Emvh3GwlyD*&*-cHjUd?j;b` z0IUYwYcwPG@jR!T%VQzHA*&7028hTT7+DM&lS=KHV{>=ltLQ#NA<@8aj6<(1eHaIe z4kAu~u0Ib6A>2<9j!!qc<4Ho}2KXqz^uX8$iPnO8)y1=X`0(Klk-L{?a;JvR19dYn zFc87I!0)dWFV6}+Z(U$)0)g1pojVIah5#VvzI5k0mjkvxB(19HR%6bB+vq=gW@L!t zaAZ7czTPSOD;k`VoJ#;>WU!)o%R>*K8|v%pv-1vYmh$1e3h~rF7M2H~VxKaJyJCgm z%$iI3fEtOxjZIK+`hmgL0{(!yXV2 zFxZ-vb;8&PkhLfVDwGX`$86cX`*z4yQq~g_h1}0*xtIYhF^$F4#lUkt6^iHe&|m7| zNI!i0M;l03KWlqDnO#sTpsvfmmv;dPwL`BHEKmgM4w*kdy*)(#Nj4|e{v0?ANGX@d zvAevy3>?}NBTGY)VKMZ7=iTUd)^FaNS6VvcTb_-W9VDLk7J47(1RqDqYK3!wF3Ul+Zi> zU~D~%1CVs$7{IYD^YM_C;%=-(AxNKY&{s_{ebn$-U(m2Yh{<-4f8sj_Cbq9-WlvEZ z_`uSyJ~in&4q5A+o|0W4rAo?20gr?P1~OpGVgqFORx`(WPHn6r$xsCXj8o{bH(+8z z=M;vHGWq4V8;~gqgYkc-p5-7PCHDx&zB^`Gliix0Q z+}gKxarr8UHmt3`)~%yctbO(O8VJdhGVMfB{7?otg@ZJwY!=AyjTR^Yst!N|ddm!- zlat?}=Vm-^=MT}u9SmHn6DHL>gM;^g%IHGh$*mOs5XTKZu)?dz>6sZ2X-CPe!CBG6 z5VCvQwv*=OLPQLJ>0|Hy{as07Zni*@fg=!#9DK)H=m2}#JIOiU+#C#a2Um><($)%uZ-mm92o7neg?u~}F` zZMpT?y*XMZ-k?zhGJSk4Rm?aGL{%6f{T;KsajH8?Fhh@Id!ImM!#BWt3tdz+N25Qn zF_s{U+LGJ1yF6*i1evHe0ZP_CNnz}J;1}nRxFqaIq?q) zhK_;MX!HvN1ycw+xfYIriH!4!V!fH4CeYuc(EkSxt*rh1nORu=cerUB&(J#bJ6F&X zu0l)N3;FcHp;Le0L@Cj$zr@38sVcHoxXDLmVUgHEsXnKbPrc8htvUlkNzsk(HGQ1}yY#=nHO1{R?Ure-Ee~ zU&!dUNAGv_`Kf{BQVI{V7@FH=gC!Q zri_+TK<%t`tqt(S zDn7cAJdC(|bg@B~wsOizOD_fd3oQ3~{htN(U--K2Nn@wkSt|rqrI>RVcd$UNjniXv zd^|PkZgg}sU%>GDLbu<`po{4pOX7sZ6jQru50&50(DJ#f$ zq{B0?d=MX!eQ(to{D+Fy^XK1yhyf=I1F%N?T9lNJ1>FAJGwH{!6>>Y6nJHz*(d4 zLWH|v)0eHFw$vQvv>{}|hUFc2_WKUM-4VH-M-l`*1?E{Y=TD4d+TxUtJOQWz!#HNh zR{1nyfk7+Z8edXUvbvZ8jV%-ct+KRX?A{x&%L84b-Wr*gpiYu=2ZPY)SfzR2@5O0J zO&b>8*C6-`EjG`mGEnDW!X}Qe(bCc7p+5c|IEzUK1>EpSwniJqc92{AFs~5H2q>Hr z&~X!H7iCo!Yncom=nFsv0cKOroUX2_Qv9T`3h3V})c;A8Ry?%hD~o1Cm5RP*JvFr! zdT>x<4e9D|d8pfst;K(LLY@p)M+FE#lvepZe#eC&VGL1EU_l6b%=8*357CX+)hRA7 zw62W9_k&xM4NQ^92hg$SU=9aHLKHqgoUEYb#!=1dlm2^G6byyen~bnPC)%hS5XSd z=t%(s6gi;RPGK5kdq9c)H=*m;crR^vnXlA`tD7BS+Rwf4K5)GwyCS zv@fBoRVX-#_C|0P%97$SKwviWcE-#@tgH42tF^V$1y%N6%LIKMC#jj@0Qln z)4Oko)%Xail%yoza~U5#aG|k{K;fM8g}NrK&Ja4)OK~?O_r_L$YcOa|^?|8K%g}zQ zY!Ztb;794gig*&hfeOGjH}Y3opK>Qf8~=e8GXft{_;c3p8vkO?rhFc4)X}{nA|kE& ziUh-HyH5#vg_Vu%5q>FlyP3*UW56rQ$}i_q%7HE<0FejqeeUAL-i48@18i*F&O=1! z0GjQiT1F9|Aw5vY6g4$9WO<=4+)=M@jhYWVG5>B4gO>CF+_fF^Pk;X`7}3xb5g9Qc z=N_ic*Q%-JE;uK~pkI>%>OkN=0vw814y)b|1z3z_{Qagt^JvhY+Btm%-8l#Z;_`zl z0sbBa>>KFVwlFfK%&o^z`{CM$jv&?mA6` zB&N1azjP(Ga!84X(dp>x2gaUFOl)De%>jIa{7(>|fsp)NTje%Kt>;-&OH~QL4trds zroHI})S&Cpn!OadCHF7BR7&)1y-D$tn3$nW)D_1}4i2AXwl{B{!sNEw^$+nXDR(jQ z_iFk-p^$CZC+Wmn>)mj69vt8!pZ)vlkdeWwHT#}49i9yNhjiZbZ$kV38Bc9ceDogJ zkB9M3PnA#83VMQDE{|!}c`D}W`dFxhPe7K?vL4GB%X*ETq$0p}}jnC^$ zKIn_zd}>$&kMRefndlrquUk{JIZqm2zHlhfs{7$w)&x$r)g&~fUsH8*GCgpTZyimQuD@L;DiklNpgu zHb)GKDLT;_%VXXtcf2M0hL$_>pZBV(HA!!M38FCYHLlug{7kGK2ivL^+Ak6XE(!cf z6zNl;QVqhE;kKU`D9Rn|p8BO-eJ$JRI(W>%r@y%KNmh_-acY^n?MH!OTEh~M4ddnam-mP74)`SEeCl27wjFI>XM4H4HTn4MYOEXQ5t{QjVYH843l-YS} zr&)WmuHA-P9p3`{xm)J5sD<8le`jv*w@PUcxFtpVexX6LI2L&Wt6iodmuW~=WpdRj;yoYsuwvy%G$l_h*^IE?gI|~Ymx+`@)&UGw17*mWx)-x4F{{-_&C_a&Ur>$&{TZ{PoZjz` z-*tD)6tH+-=clYjzx=Eqp6A?`tBGMoS1Bh$xN>%R22(N3; z&jWUS6Ooi@%LQp4mFiQ>9Seeg9^*~WKC^|jR}!#)h-@$UmgQ%*VJQ#NTYk)0l+|e~3Sw+=T(Lh2E8kvc;v2xf zfIPE?7{C&AzQ6C)N%7ykVUr|5;<@b zbrD`jpyk`s?%rO7bZU}e-0f;}@_gZ()fy~?FA^1Vsf}#!cJDeY;c6K&rd8~oI%_50 z*2>j6VJN62$rzxN;{I!d<}0Q8nJd-hPk97?RV_Oxuya4%ckpY-XXct!8bgmQA{9#S zr|55wY}YNHcC6L9q|3XUGTIZuvj}>lAA?-jKoavg?e3>HeH||at~~va+tBPMy3^N4 zZDd60{?F|Le9Lo1cApM9|Cmfy^ZfpTasK$PY}5#`s=7xm>bVr7*aboEC0&mT|1Pmk z+r6S>?^WRDJkZk{8hZ9hY5vpF>Va_^8s;;0bmuyJ80D(Xc1>6dVZ&+W&Ng5#u!=dY zEF20cZ+TxPtfe2PsZNy@lCIpgm^r)8t2jzDdO_rwOFyJ@k^~1 zx0)kas(tf)l+|d0WOV0}_V=V;53V=9#(H$DT3f!BF{EBaZY6W@vF|M zt93p%)1&MAj%yc+>HJ=?YwP5Ov98`-f6v-9#838~r{HezFL0UI6&)b|7(Yp?u>9Ph z*vo5!b!ZHvVd?yokicac`0eA8&!lQg$ezNs{ET`r@h5qogRP9!cCcTmtaZTMUcd2< zMpYZp(xq0^sM@yrgKhQkkpQM z80nT1T|vuFSZBCTim?Ypf!nm&&+MT)?qtN@+ibEdO7 z1bQMG9f-w14Us+H9ckJ0RmC_%l0ck*dSR~Vf}sj>$yN7YqVR-r-3b?U89f$R^$^qS z;?tm5vuQU+FObQO3tIj$^`YXhz+ak5M)$PI|t~J?;ru zysf?c^3C#7oyr$VtUv4?E<0kCR$mqA%(~UYk?yu(;1><;wWUr$kyqvF!N%kCQH{F~SdQP{_`?!ew zr`Hy5Toc!u>I{U*Zw^Y8-XwACsE}oDbG>uRKBk^84t1d?XC61WCxpU>Cer%Si!o7TE^PKX8)k!syz3(5y(5A3&@4b<5$MjQA zLh}3SuoV6KTFpgsjrH|j@LU84>VhQg0V3N2%>bnaI%rJF^pI4e8W#XxFI`v*uK1JY zDa;Rg&8df>(s+ky1#Nf*xV1y7Uo={hu-L$FkF`0`Yy&RLB1io)G(8vntg)nZfzXx3%iZs{}ayG!5ukxxH z=s(d;;LP#(GdSfnFO@IUfwu)<(9zXp-fZP&#!cF=W6%L^hzYRjgoO!E_K8ZEQ-cm6VP`nlq8QK~T8pZfZ;m!n+ZcP`P{ zFTGiID2UqAFWoi<*=;r!R#6*hcZxkbc4!Qvt~K~4SJjbU200I=&J8ZJdIYI%kMoPS z{$i4QGI`20j!pEZ)YsOkwoBPmcY!Wo?o zwaRs8ZMi0nI>u6cKcK5+=u^v};Qz2#bWl7b@BN-aik-6TCtrRMm|6JC*Pv{GXYq~{ zEq>tW6t|dyl4wf$g3^9^-d>G@Bbuo$x?7B2)Sg#x7oy>`(;LYxu6KXQ{Agr-a6t9x&2X+4T54YiJoOX_Iov_$nAotQVX#jiG)Km1NH4v^-f>US5bAyT-&Rewb1Ppz)-D)0n_JPu$#CxwxpWY!&v1FFTc}~kVP9{u-{v9vhmHvMjT}Kz2JEmKnUALz82TE^ zvT$>HuVua6re~a+7Ai@XVrU?Dgz30GYGK zTJ<7SllNbjz(5FGCC+NBV|AmtZO`^`8*^&?V#xbIWO@e#xHz3sTYmHUH6ir^0s>Ss zYLk+dtJ8;e9{w6?pI=?) zu%GrKJ;UxA^R9%?^o3>om?1Ta;zdklH59UU>vKJkF39tzzT%rZHq~?9p91f{GBtIr z)lYU@arjjm>xp+pcs1@1@6nKKaZk?*mhLU6-?)6VzT4TJp30ji>XZ)OWVfR|6_NeWR+3?mQ&FpcpEiJb#`Q>IWN%5+ zN_YF$LUVHdE$AFdjP8|DlxHWWv;G4f$`x*hqltIA8;1%X=IeL`7~ZI_*+0F9cUGp4 zRaR9oy?>j6pcxJw7Iaxt0yhJtiVJdG(_4Cdjy>lX-XEGWfjN%w~{@$s^Q zV)MGITH;c;%xc;0%)R$2R`4iUJQ6b7)j_LWi*wSW+)=7a+U5|yU%XQ0VV6TRskHj7 z9c5H1b)RXB+Daa|txH-Ck$$>0bDm@CMFo{#*DMZ>H>?q9P}v@=w>N)1&o9yKTm5o< zPer{|JsjV`>v+IXLH^@67C~$6Gk>9p6KPbrQdya27yUeB1xyWTf4@M%EB1f)ab9Vjm^&f|`qDMyKVGO2 z`w__!E9O<3R+E)+03%%G9J8hnjcJ6lx*AQOoA==>>YFth#zkIl-}IMoWWns;J`lw)d49*f)H|TSHN_r6DX~oy2-s?Yc*MdDu z@sZ;p_nu-87xZD{?QT~;@tk?5VB+fGFeJV!VeiXBZ@%d%=es=KeQm$^L^(}OVU(yC z|FjUTLA1Zn7b^5U-__UYp4Crcl+j-FoE5?!iZ}(l@nX#AZ9-YMsBV8R!fs0@2)sC2z z)6au^VLay?x7sIJ*H+ddv&iZE@y*36Y4PGMM%IqIpH5$M9~{Upn7dr3s5EA-LKCzn zrm#Sun_;)z2W!L2wJyWi!;`@~pW;@1Ua8uCY}Um1_;m{}-Mr9Tf9i{3T~9sJc>Jne z)t?-1taK~BB|6FExXydSyyfU?E&dP}cNdp^JUkw+UcF*4!aAk&pHe=|&g;?b#QP>n zq10^co?izWTmPEAXEIro`XM@oMB>}W3MqP`NNlC$c`mvq-l=zX}*m&_;4bkuw1 zpgL5(|66kYbD9aSo=I62=w;A7PY#6IZ3Drz{I47+LA%*IV4(Y9Q^x|?FD{-@kmO3_ zK*U%IB7l@N=>GS!Eh)LDrKJfPw}=rB8w{zZfC0?`m!>u>2DD8)PY`2*KaqlbXchV2 zwDR2B?^7~;ZEOrA0#DAXemJM0 z)vr&tp0Ln8kr4u4aV7T_SmX%4k<;#|E zuiAJad_L@4OiO(h$y~o0{OGg}^|W`PR_cydDPEI3*qt?Wa>vY~@jH->2}t~rn@dJg ziDn|0Qz&L%oV>Yqm&X|cgYnFDf7NB~IeAh#`TEwa9O8}1ry7%fds<8>tM4>* z%(pqE_qrSPuz7*?R^r547Ecdb{o3#++i3Ex&HtAiO8@sgRB=256vNlBeA1$Z7!Kby4`jh?f8DS8WFQK0T(%~tF_d$E zeFcax3!tn>B=td_C-X(<+^80l@qff`mOU+<4Y0x*JJlL8Z<1kv#54k%eFEZuys{#Z zZ{K2Iue<2(pZT z6!<7GWy+p7K>?5DE9@HWJvUa7Nf44CqU|IR2RL2VAUZ@o&&x&X9F{bkL}F^z-Lzj=JhEbZZ+F{F?Y|5L8xUHg?{)%d}Bq z6n34}ZG(dw?}16AfMuNa0F@eCQI%kHdg!Vqw9?$w>uKG+8goNd_)Ru=x<1 zc>`b%Yz5;ON~$rGHSSJ>MG^XsXEVm`P;HaECbZ;8R6(rT#;>?vU(tuBfJP>IFlZ8p z3&u~)W&@-TM4$p99_mlAk&GE8I6idY41%Zv*R>ca~ zEmwnY6u<+qE@{ACci;WINq1M*C?<#jB^V;PdCh7>(!0dp5sr z|I*zAkzg^Hces8oWp-nKBI9xtu|#BT5y8SlDrTAqaFQg2iG=C-_|Rg6*$*8hP;@fW zh?=pJ{u8S-uc6^3;r*-Lv6~iuq*W&m3|}T3ELzhma39$x zj1f!}7k0DY**+3?gzX{VrhfXBNoO7;li6!$|E&dRcmc68pKci=nrssJaqCB<*PPQ7 zwoKgT&)SgcCK}W~M`xia5a5qMjufZ?7_rV=@VUWt%J}o$CpagB65BzMLV7`RZ-}#y z{DVQCB6ohp1|k(AX@xDuefMF)&C~gdj3I#$5EGy6v;lIU6yar}AZj{j80}yg0#E)4 zv6qmoLC?TXWHV6NcR-TSv#-Fk7qUR^Ni~wtSeId}~&AI~PlZ4~(mGYM0{95y&6=p}t{rexDUU#nK)FoN{ z)CcUe9Pc@lHst$KO%RYOxOf23;gMi6(++roEeDqPC(Np;@oc3bA}bvJ$6 zyB3!Va^^%?_H!P%I?~(emCstQADkgEaC5|LS~nJngRsM6;jl|cWW8vSwBGV-gZ+1F z8=ESuifhq|e?vwuQydCQ4^S6E(tNR=i0F4)PpUY?B>6%m<>loxFo}UtFU8HD#eI{K zmDL7hjgJVJM+)`~?v^8760fn1fF^#@%HNF4wo<6!{1KgZw2mNxUONxEz1Rn}0Bk1T2{4Zc7C2jBNP3LpFyJR~*a15rvQ_zL zMK5}FJ1-nZ-hqMCUlBDXyj$4F9pw~j3W6Z!HMy$oE-ipvm_!6=Ql*8 z2nUWB7QwqU-)8J9CNF(*Wi{lDg;?JuMskxVx6fX_Bw7p^7_ks&%u$ny;tNr&`Lps+ z33c_I<5I4ko+Oxu#I6D&CT>-TpUi5RO3`J&8J%-))tY+`-j-rUK_-Lp(LomRg~0?= zQYVO!1W{*Bb|<%1d@m|;ML$D^kn_$5S!V7a3FxDG)&7izEWT8@TAtxP1E4;82d-T_iUY_mL9Jkd?EiK6#MSq9d zfKk-J8JBz9k6Sv$v|C0Z8OP$4@r74rVr~sto{XZa?|FEXIyrNPOXZlXtcE5H8nP$# zd&+@G6+-O_!vNG~K6>^LE=NF4g$d%>ix(ti7{{YSou=E1mpEG|(5S>2H6H~VD~bgR zsUL9yMYrHwufu|Z)&&CiXFfiU;Bz4n%W%R#vO}_6P2qtMxP9(EQD7}ET91#9>(xXD z+?s<;K?(;R&OKr@gQREl$CZm?p(~4z(G-%Bi;)fcU1!%BUKSX7?BM@GsVA3)(>pFH zDZ;e7C}MjTj2>hcg0-znytN&Blf*-#XQMmna^d2|d<{ObWH4IE6f+1Ll|WWo2AwQ9 zc~Z>#w_QpfnIZ=^_M<7(VQ9XHbq(4a&ctS@Z?VB-56t4Tx-*JCM-8t+1;&0X!2&J9 zMeIVKixY~>Qz!;o=;>!ZwJLKU51trcvQdwq$2@4N-hdtg)dVm%9rQneaBY}&=50cb z2drVNqM|9^8=+e7!Op#jSs6rL9E69ko87AWv=7?wc96w4Z{GBu%A`Mgd0{4|@}$Jd zq98U*!^-l_AKT~YQOyP60@9KeQAfv0$E#L?aGiVv*={-^EiD~aqm9uLCJtF)G3ZC= zkS%lQbDbp95d;Y$dbt4JUxW}cM5?9;KpF~@WWIsk5N;phcLX<8TbP^QM9dqcnOk@5 zItM)`PIlPaVxnKJ-chn-0DB}-YjlLC@SND;b<4rNL5Fb#s%bU5F-feAJe;e$d z4W-ssbCQLK0TC>K##S}$?j~FX)O{Z4lhLSt1H}T{H~KK^ftX}P7z^M_6*8!MMtl*< zp)jOTZf0!5qkD(5R6g?3edy}Yex8La6N=OvgcqO%MPYKA%2-Bz59wnFln=#sf5T@k z$QgyE?ye>*5!$Xe2*=<+KL@i2q=IN#65ymk#gjzkBMI;LT%?9rPxN>N1e}B7@)mlV zsH|F3<7A1~Z}BKe*vZEQIkdQ>V>#$wpY2@Ka%_4FJDKfk!>2fyF7@^#?_k7Q} z$+zl{iWyw{DO*-Q}B}E=I-y2rm5rlc4LPAOQksYSnD|!v&sRI=#$| zjYrh@aQGul5D}~2AkZ9}n&KI#IDNV#@<8H?gHb!Y9=GFx5j#0{%*$<;fC}R2_2O&M z*VBAa21pAXV%-xEzxn*>w_B$Ei3sV-JB=<2e{S$g|C6Ed;-9}h_zysEdD}k;B4-oD zUZIbB@$X0yPe!&dnm%~p4-RZ0daBc>nMD7SrtxO~KPswok!0q7f*JPtKiV(0e{hHY z)$i{U4GSlp4Yv0qLqpdGQ_NV2>ACjW|6jlM$kan$7GvX)8%rO9QDlxKndSk<@*$#b%PU|$&^Za&ywM;uv3=KTc zs(oLLExMlb-0JzWY7?Kx+C%?Etli%J{)###1?o;X+i_utq`w03GdNFe&PF^XEI7dr zS%3T>WGI1G>o5;aaelOf!XFr*;Kun+@#*ttBKssi7OTcr&53(2pj~41-o4uuUO*T1 zP(QzXRPuhlcG{-%_PH5tpTE6c(F1#@$9Izy%i$z_FR z)h%QASR>E)D*(-4_Fv(gcyuUF4P7LPcNH=mi1%R7q9t>rbzmpnop2NfH`gUTf%ll# z3A%`)E_O+Ukf~@x0z^zY)?}y^)j*U8C;Wc6EFhYt;|#@cjpG9*N^k6Ef=J=$MZZAy z(~0c0Ubt>EoWD4?tdP|Vy-Hxc4OV9!S}|h~w&&5S;at`N=S$KRb@uRK;wFk#l;ly& zc&#&O#QRSyO(1sR+ASDu&mp~y*A#&tA*~F+Ttk89s)cL@bjYiK#R0gqsvUWR&NLng z8>nMvP$YNZXn=iLCh&*{tftNK<$6Ll^z~KxGSZjqUc>tY%%8+apvCi~Toxm$a2x^b ze0&v&+{p2VkW@=wzZiy#;dv(bpcjOe?bYJKnd1vw{831UdnKIzqT9VSR(b;J0NgS!%XEdh_SO!g$LgN<$N zo60A^XqD=56_B+CDw&!OoS(pAaA%fiNu+5}c6bLm^MR8SX#zMoU4fIJ@}7@6?As2_ zD%K?P!BvkQ+#Donp(u)P?B>Q{dhZWo(M}6FZHDp@rq8r(6u_MXdHw9fth{S&G(PzGrnF4R8wP+q~ovS?)I(C8EYDiEDER3)9MOyr*epPt3* z2nx|wk)TTAxJ04k`&o~-3c!s{f%J7}jE`pMOWe=AQ4%AFjz0oBgpFHnVj6^%wbej8 zS#Y-p$r}cM00$f(2QI}FQ#O?BH2ozg5KQ27s$NTv#{;N>29mPkgw$I(ij>tp>W^t=S>h;h6kz+|jL60!-RKgRoO+EEcUG8}OS zh7o|(fqBvuCoM6@VP+!Pc%<_JtBpjR3s?uT2Nq!@yMetz%x+Kv^Fxb7a%dTh)3ebS zNt5_SR4^RfG(xA9n3%D1-e7eiT`T?)S&IbJfC$5q=fmYUdDn}F^FYWWn}|edtEq)Z z+I%CM8zCU)WM#t<{f)Vr3UdL-fP3hv@wr%0;_xkq05c}57w7UG5N;s2NXiSDm=dNU z5W9lmxB6-oeqTJ~=BQujxziCiP4GI41=Rlt@1H2e`~Xgpj9Z^V1_H5qo(A6*CZ;m{ z^iRpjy>KdaA^DdtcN%46J51Avph1)V9W&>STC{&rY8k2hjtDp_&03z~#S0-Y{%K+l zL$gS?Yl29p&|DCl!y54=Bq9bcduRu;PbwcBk1`(+CIFhZUp~LHG;e_}$Z&cYdH+tt zZ3x{z=(=6-df;?=)UapQE&{1x8IfFbcN~FX0q>ZG%(C97uXy*2~L2g6ybde>lnqYBy)x!q@W|=O`~i>rw`eL z8iERn<#lmIIt$B!?bsv83(m$=gmN$j433m* z5|9gZzhil)WA=l!2rVFAgjN3}iidTlhw#1Eo-`cSaZ0j@ha_puHn(p6JMdT?S!~QV_>AT1S5|>-c&b99v^EGs4$@ zAn8W~_EAapFkz#ny>Ry;MS%i+%dX7X4(eBX!?2FIVCntH;fz)g1)IiUuA82MyiDWD zyQlqiuv3t?)WE{9_P5pzT_6bo#1SOZ8crY^j1dlDR+v36U%tFpzOq<;z4LQ?yZ~D= z0v^I}BhiQDy?991JJF_DkEsOb=HXz!h531exfvnj#=u4b9UWc;@uGeJzqBsHR+x~z z({oo$Ze74uh4FG`kt6E+_tV&rzvm#EDbBYba)MY0iN2?_esEm^CWse1*L!>3coP zAsA1OpEy=d>5%aS(`_M&x)P2tOkXoi7u3|4@Gg~=v)Io(&+kRNeM>-cbgwzj+0GY~ zmGxjO7xK~7(IE-_+kd-X6Qgu#zM`zbT=V-KJP51?r0?2P22T*NBH;`nx*c-L0`X@_ zR)2S45B535jv)D(4+`Z5_NXC22*ZVAi%23t4HVp8Ln+gZpkdOY5^x^{r(y6jvi^<) zkCJ#Fc&stiNCB3^Bxna_V8-1V>km8UF#@1aRp_A#BJv#oLpLzlplra;woBA>KLp1S zxQa*HE*;#tZ4hr_!Z%y@hZ9#1S9~*)1xkWMy|L#KOghhycpdEEo6{|=BaYUeY{->`())5Oe-OXz(k(tTþiShZr=& zMU3v)PY5=d#pq%+^tl%2+g-0KHp7;S%m{8LATJny)T%OAwnl92r23_hEP~oiEO&5? zAT_f2WbgIg`$!7uEt1pGo(#fe<_X2n1t2ZQ_(=2wI)1UG$?Axave%i(6B84qHfOG@ zsv@}KQ2ZuzHuAA*!NjryL>fJsHL#*pdR1>-`a8IH3mnKT45_&zoI>p-Jo~*LXgOPj7RXX-vEaSv}+}#cPCre{>iQMTeq5&hdyt>?Ij!z zmNS|D0Ms#~7Gg*zCp?KM!^bA?WkD9r1g1ptVx>I1PYbmi^Jm3i*NPF`NWj);&_w4W z{|5dSJuA;eO%fmkQ};~(^&~@+%zOyeL*6!#A>tq;L8U+g07#nDS`e%V22!H7#p@5& zAw)^vs}4CU1;Aqo-1sRjj@Z@VB@ZkL6gIwq6m}T8JILF4aN0-2qao1L*3KpQ&A6q& zvQK+8;(%30$@+>E8A?h@(mD_beZeT}Ao!No*xLY&Azj5g0QM5Ywa-jn$(Wp)%EfD=07qTI z$O0#%>;S1Y_$f0UN=&j)um~YwkbjeL6FNS`#5}rS#GFLD`sB7D!XOy8e*$gDsvRjb z%*XC-1a=7C!p+I)l-I;0mOBZf#wxdjawJ26kl@cU@-B zAs7V1&_C?9Bj_Ujx`%}Sp0MxX?O!~}2zsc=#HhuR8$I1s<@%P=kNw<*Q3z*M`q~#UF+fI!~gog(->-A5E zly(@c+(l8uQt@BDYhj^{(>5Z@*#1b<{7K=R8&702mZH@rKv1;}s+)0A2t-gg^M-d# z43Tk4RW<0=`kgzPo^)S851@_q{zSHF3dm#(Z`p`3af56Lpe9$13*HGGz*?wFZalW1q44=1CUsWJVtLEc% zvO}4}hso zFkz5mxuGv032xO}np99qvO$n4cWp673kG-vksdz%C;Ntew-{IN^$X5TU%m`eaT`vd zh_Gx+vjL{R0Gpv$#KsjKi-wE^elJ` zikWuSUfpE1oIZUA*f3uI<-#)4jySl$J!X>D&pOrf&(=fL&JLd|sR^1%SdTf#vOI^zx*TDjlyLS&w25SMgNY$fSoAC;* zKj%36<6MiZa;HX75s_!UzB)1sh_uRR22QPtP z#@{9!#ksD->I(LXsW0!GC9-W%iVo9H`eH6Z3~4b?3%;Ej?ZBuKrn;l!B-k%(U{)OX z=7*=I^R-?)1fGjKX9sWtMq_^?CqPI>n>?EkI&|hurI7Ahbg-C`#*zQAm7e}F-p_ym zdq$QMFQowAap3Ubsr$^@m$sqr1eH5#{4 zhw+R*ZSGr)+DpPjV;y4i>+deRDqnKx&fmoM;*@<4>;}3|g#R!@S7u-kealMW5fv?X z3~r$yDyj=oMnBC=O_9|=^QO|O{O+1W!$!PEci}0~|5jCz49pbF`1UJ)<5nM#!-pGf zx3V;&b85l}!{kxCRD~UKQ7kcf>#T>3GfN%uadGV!LH7y>Y&&Sf?0}98sdOZX726lb zl4cs;Y>_SjKq_Zs6wE^GlP%Pn<1DX`cd@Shkkfns$#nO zrm}!kR=npCI~n&aq97I17upt3FOMtrZesBwUk@F^d1d9@2$71wk0%p90(ase>LIW4 zLO6+r^a(V57cuCqoh9nPnB*}0U~-2eFQ)PA_0BWeUQ0e zVPIQ2%7`e$`$x5ugOujNFU| zetrsGr*0Zu*Wggk6a!sAA|A{a#;YbFcbOnmR@t$UHtY^yJEcZ$c!Op+iD5!z#llUm z_apy?Sc`DLYD7AKDny&AY;ztPiIiHT3U{IEBE{-pDWkS6GtvV#$I8Q1MINF2{QRvr5AQO478omiHtjem)a$K>^+c*k<5)rO)AOnC2 zG9U|70~iAdgdO)yPv92p19S*z< z6hZ68Wy+isAAbXZ8${&=wZuuwrp)fYpRO#}*PQFOMgrO#eEj6tCip16?L^`BdPjAN*e+9yRNG=)7qT0K(sorW5up$Hha5xX<%sH0|FJ|GnV;%ol*PIq%seIA zT^SxyAt(2;JT);cE@j|Zye-G@7V7gr)pr8p2!}V92$InGajl}Y-iWy=3VKX0TO1ce z5Cgyq3k5W-cS!pZy*Ai*bUw^QsYvBnzEoodNCVjy8h1|}og1hOsyO>BHrCkXxikXF zZCf%vM59xkK-&sAnhY>h@Q2!ao

%RSqo@VoH6nYzdVZ92}g>q`=mJxD?b9Hw!aX zYxDn7J^m-*{eQzw{ZHwpZfH@@UImJy^my-Y25h|G^0xVVP}}_zzJK=Vza!wEa}rvbmtgAqs1g%P)lH(We<y`T7WQW!tuAjGm(eFL;!kG1f4fu=2f)JE_H>c5Hz(T{rBUb)!E+E@11 zq%YVnd@w4W zYy_T2p?`X7esF{RM$(NVf|!_T4H?*EPeQVB@yr?LZI`@`VcT5B#4AvrRH+B?#e10~ z9{fsA8n!S`7exNts9i$9AdxtsD@A}!PP74dO7ikC@SbE`2Hy0I;Ln5gRdrJP}k1 zdzcF*4h_DYGTQ(D*e%xTS19_BLyIhTSHP58wrtTTj37d4Eh)2;xh24!t&nkz<8|MW zBQ?zuQ2Tsl>n-NnpOK+Y$e?!L}0Ba zI78fB7qKG1RicRFfqoBq`A5u-i(cp@cf3yqxCXlIJBDHsaD((j3Uu}S@B@QW%mqY; zCj)EzOEo{3NpR?G38c+a0HMYRYiS!9biNd3dz-A#t?*^2qLo^PPQ6U21OQmm3}R0_Z1j6(9Yq|$Fk`~H6+@ZdXRK@Q=enhci!>6AWD{naxT$x zD_+vOpeHTus`R`MfiRFHQT>d9Y69FAcVZcaSah;yFI{?eDC{uz)2^fh;c}6z zVeNj4`Go`nTi6W*1qY)gPV?mf%#D@_bEqsr2>X71sJ%Y0YvVdB;5=~4csk;M5d_#i zAln6_Q37H{<@B8j)I9)@VKT6?v044h-(L!My!00&wopdmb&_8j8XBTY0L?(ZLEcX5 zmP-QVkB;V@c2@qj3hG6V!5_=3@B>DnA3^K|H7(+p#vhcUB z+5&R_yJzMG7L#aoj8N@(--G9V28KYEP+H{|9h);gplLJMD||?((?++u8s~lBi?s;a}Ue;?&J76&ulBpVv5{4tRx+rYD1Ianw8d+vRa`ismVId zDmmovI2U=^!GqNTik$~$J1Y3cU|4Te)sSDIlSNR&-?QP zZ(?)GP?=sAymXK5uwg6s(-k!}5fHE>9HlJ1r>z(m%I{M-9q}n&dCQN=M{0ZZZ8|r%Si4FBI^K4SF5p5ZIgdIrE9DE)GF+v7f?a^elw)tC2D=QXPxTq#imc>=fd+5^9 z=}%t*9fSNKg7&I-hode$jiM0aVU{3@RuWc}Jd8ZrIOlZ`7pi)3d5Jn?!w05451CLS z<%OXA3haUxKuekD+0;*LsaKbMT^Ls0LTKz@xV=GSE+W;%(9n%a;@H!=qr_vH!aN?8 zTR&uu1jK3+NTdM7t|mE`+_>9E84(jB+a)X$gnr{ZyXqxKKlmxRV;m3ELYigJ+5Uj{ z=n&-sD2`B0N?XRnMZP=eG}(*xdV&IzXTX&Cv5z86 zV{ky1ExS>pmSBc}^G24N#e*Zo6ZAvgvQ<^3dZ!KX^zwo&*H*~g2T=&Wjc^Z%zR;IH zJRpRMaUbM(An1Zj<$)NEi4P&K%X-&1*I~X($Ojqk*LZkAj)hl;!R93mk0i~?{uu`u zRJrCip%HvQhUfM53#Ghl8D{;uj%EG*`?6TpWAJLzZ+=d(fkWwjfkgYd*3nx-1Ia}N zHJv;<3mT5mfrZ3c8L^;dWtU#P1pcbxHf3!B1i2<=Z`X&vj!>-eTFri`i@!qQg?pH zV}p9Mx4ODI_@hXTc%dSs;&9JwRIk0`9s>)0AD>yNVerU(76mYo6|1;C7Dg^AEWQMSfYZ{ib&#NllI?lJw8(x39|m9l zON#i70`Onvx1o{9PEOPu6GAa^SVZ`XT|I%CnO1^;8GeOIT)u|y9GRsVNDEfGeQTYaxl*=8 zL`F89G8$sGJdP^7x%^>7ga>3mEWzR0p;2SUCgBR&!&=I1-zCgAbfOQX81GGLQ(11CY*XVtl(`&Sbto8TUP@0A zY!8I_4J3yx(`m>spma_CuoQ)whsTT&rOcVe7OYuaF<}IkI;HuGu&_=%KeO3jpdk2f zK?H$#O*R$rz$1xDaPfUgiP%R|vs126L9mIihaOD1R900b-+qS5DxF6O!k{@XA+q@) zh3oN_CyQkq3>Kz|Uaijc4Q?UsuOg%pjrXQ;3P6A>p;0O@L?q6SX0(R3#u9^VvbsXpIOfD6fo(?< zXvJm=4Ww-TArczz3E{|#^v9#bG}hV{;E5J%IB#m;oN=GS=L-(6ddR$#ieW98xq~gz z!7xOBY${QF3atSq+G-?Pc2#~aat)b-0%Xpfy^#y9tcR-eoh2eCJ|JZJgF^`(qDV&@ zsg}#_7(m;K^lKBENRg(C3?6w8{uXxhJ8TwavTFlKq( z(zWWGmCX)Kv6`p%l-UHk$O=FyAuj>2&GUXVVrPd!<}@gp@!2nDWC?+@Hu3&=Ys)9H zQ=}}QqUYS;hcl2F^~|M}M0cEDR(AZuf%?8{KoBT1ir#){lUu-@l#f-;PEKbwSipr) zbU5#@CtU7C3ZCva7Z44rmhT+`%?r{ZItK;>><2qVbgS+D%QZS7pT@GcZIqCITiQ$( zdCBw`X{g_>YY2Uq7gX^)y>X&>w1c6^9>&h;38Lw?X|PYz>=tob)zsA&Qh6nKClu)_ls*>4Y;oY4j_Yq;k{!48hoU<&DnBHKs}Hv z3w9gt(Z^ET;ID4Ix(-<02+lfsL18aB!!YUJaPg*D zR2E7Z^e$a^lE~3D?5XDAWM{|*+AXcyJ2hfA|BO$UefrdElbgM4yz5c&3K$1x)RVh~ z(pIAAuwMm_mv;coKTN!faf{tHgtiJ6_YfGww z{4$2#2vpi%`!9s=FGzcKO$T4T?ie2z7xwJSaTHf^o6jsOGx%8t-{Kn=HeqPue#6Vz z>KM1xI&3w*b9u$H8~KL8%U!J7-u^-2X1#{bYR*rxDVkTZZh)I{f}dvF4?@O$@%*Y^ z@W%f}Lf;UP;KUlQ;@%~V0EzxrNgNo%P4)KPD>%n5z3!r;?e`#IE9h_~3j5t@8|ceA z7oItzH)2Hf`{8plD8s*_ZvYI5wLXd9hm~rN=bWZQh0x0OX-jL38L8*3&!?!>yhZ`Y z4cBz_c6VR3Z{NLnUnLrk9J!|T*|k;=wo{0{vUUswET~~I%#~A&ePv6#LR~*Ah+n{P zZud(%@^Kmrwp9)3NcYL{fzHo9`0}=k6o|6QjJ=7E=MPU8`LwR?WVId5xBd)->{$?O z2X?A;wC)eNP}%v^g2{MCF{(qL0ZQCBH`AwF#b8M!X`FLB<~8!i+wdsq;AJw(0+;gR zvhfP>^ph!$tQ1N=N3z9_SFef+4ct!fLAW;Md72;zW)ygI6e8>(!5qNxEc30s*z^%w z`aU(&Fqrb!w}5MtUz|zfhcMhozG1qch*PUTrPVPl_|X7jmaH8Ri9L#&q`A&V{k;%# z<$;w9AOs`9JaW&U(*G=N>Y2lt{0rhOKr(3p=#i0b0>T!0M{v~cq1?1$NG#%^6=N}I z(>#TK7-(F$JB1Gv+qmqDW!AB43@OjS&iM|NG#Os_3VTvue=Q*%6S+C51 zVhW}n>r+$h2^mu4!2WmHM2Kky8$ff`@jPHCH~=Ern=;KMJs?&4*QJtAP~M32P9e*J zgw;ca*6)KgG)olSqCApaY??iC%TKKlp#2ZZO;VX0n-5ht7x^*F!&=6Uxo zkH7hXCe<0EN>%MK|GNVL7#UJaPWYj;bYf+p8A{ftgWRxK`>+&w?e{#EpPbOp3DKcC!fR|}i~a8l2jh)hmy5m$n$!bX zct#q!udNp=q;&X)V8qo7sKDV#IeX*!b#ox5sV0U7wklNzunD4G4u@H zWyiiHy^Uokld}=B>8_Nz!lu%Ce9kT=(zLJ;N_h^Ls1cPCqF2%F!u7Q;(Ob`AdLH^; z(cSBoEoYE~$hGa4LLU#%McGA`p$Q=UuR514hNjIb0GgO!SZX&9C*~a zTU!@&y&?w>)H2)Ev?l^5-IjG7ri1if%kzTWI73cz0^N{jtwt0F?R3LKiV+($(*Rqw9Q;Mmq@GF z#@4+EB~GW45m71Q;j@EEmthq24G1Ci)YVp(&5cd1?JFHtIYQl_+Q*-odQL0vl;}6ueO 61s **BackupSession:** ```console +$ kubectl get backupsession -n demo +NAME BACKUPCONFIGURATION PHASE AGE +sample-postgres-backup-1560350521 sample-postgres-backup Succeeded 88s ``` **Verify Backup:** +Repository: + +```console +$ kubectl get repository -n demo gcs-repo +NAME INTEGRITY SIZE SNAPSHOT-COUNT LAST-SUCCESSFUL-BACKUP AGE +gcs-repo true 3.441 KiB 1 31s 17m +``` +Image: + +

+  Backup data in GCS Bucket +
Fig: Backup data in GCS Bucket
+
+ ## Restore PostgreSQL +**Deploy Restored Database:** + +```yaml +apiVersion: kubedb.com/v1alpha1 +kind: Postgres +metadata: + name: restored-postgres + namespace: demo +spec: + version: "11.2" + storageType: Durable + databaseSecret: + secretName: sample-postgres-auth # use same secret as original the database + storage: + storageClassName: "standard" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + init: + stashRestoreSession: + name: sample-postgres-restore + terminationPolicy: Delete +``` + +```console +$ kubectl apply -f ./docs/examples/restore/restored-postgres.yaml +postgres.kubedb.com/restored-postgres created +``` + +```console +$ kubectl get pg -n demo restored-postgres +NAME VERSION STATUS AGE +restored-postgres 11.2 Initializing 3m21s +``` + +appbinding + +```console +$ kubectl get appbindings -n demo restored-postgres +NAME AGE +restored-postgres 9m59s +``` + +RestoreSession: + +```yaml +apiVersion: stash.appscode.com/v1beta1 +kind: RestoreSession +metadata: + name: sample-postgres-restore + namespace: demo + labels: + kubedb.com/kind: Postgres +spec: + task: + name: pg-restore + repository: + name: gcs-repo + target: + ref: + apiVersion: appcatalog.appscode.com/v1alpha1 + kind: AppBinding + name: restored-postgres + rules: + - snapshots: [latest] +``` + +```console +$ kubectl apply -f ./docs/examples/restore/restoresession.yaml +restoresession.stash.appscode.com/sample-postgres-restore created +``` + +```console +$ kubectl get restoresession -n demo sample-postgres-restore +NAME REPOSITORY-NAME PHASE AGE +sample-postgres-restore gcs-repo Succeeded 43s +``` + +**Verify Restored Data:** + +```console +$ kubectl get pg -n demo restored-postgres +NAME VERSION STATUS AGE +restored-postgres 11.2 Running 2m16s +``` + +Verify data: + +```console +$ kubectl get pods -n demo --selector="kubedb.com/name=restored-postgres" +NAME READY STATUS RESTARTS AGE +sample-postgres-0 1/1 Running 0 8m58s +``` + +```console +$ kubectl get pods -n demo --selector="kubedb.com/name=restored-postgres" +NAME READY STATUS RESTARTS AGE +restored-postgres-0 1/1 Running 0 3m15s +``` + +```console +$ kubectl exec -it -n demo restored-postgres-0 sh +# login as "postgres" superuser. +/ # psql -U postgres +psql (11.2) +Type "help" for help. + +# list available databases +postgres=# \l + List of databases + Name | Owner | Encoding | Collate | Ctype | Access privileges +-----------+----------+----------+------------+------------+----------------------- + postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | + template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + + | | | | | postgres=CTc/postgres + template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + + | | | | | postgres=CTc/postgres +(3 rows) + +# connect to "postgres" database +postgres=# \c postgres +You are now connected to database "postgres" as user "postgres". + +# check the table we had created in original database has been restored here +postgres=# \d + List of relations + Schema | Name | Type | Owner +--------+---------+-------+---------- + public | company | table | postgres +(1 row) + +# quit from the database +postgres=# \q + +# exit from the pod +/ # exit +``` + ## Cleanup + +```console +kubectl delete restoresession -n demo sample-postgres-restore +kubectl delete pg -n demo restored-postgres +kubectl delete pg -n demo sample-postgres +``` From f914d8c52d69a6719701b8aa26a6a6fbfb24cad2 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Sun, 16 Jun 2019 11:49:55 +0600 Subject: [PATCH 05/25] complete documentation --- docs/examples/backup/backupconfiguration.yaml | 2 +- docs/examples/restore/restoresession.yaml | 2 +- docs/postgres.md | 114 +++++++++++++++--- 3 files changed, 98 insertions(+), 20 deletions(-) diff --git a/docs/examples/backup/backupconfiguration.yaml b/docs/examples/backup/backupconfiguration.yaml index db21ccad8..349dee2a7 100644 --- a/docs/examples/backup/backupconfiguration.yaml +++ b/docs/examples/backup/backupconfiguration.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres-backup namespace: demo spec: - schedule: "* * * * *" + schedule: "*/5 * * * *" task: name: pg-backup repository: diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml index 996c27f25..558c1f5d3 100644 --- a/docs/examples/restore/restoresession.yaml +++ b/docs/examples/restore/restoresession.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres-restore namespace: demo labels: - kubedb.com/kind: Postgres + kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: name: pg-restore diff --git a/docs/postgres.md b/docs/postgres.md index 80b39c106..fd07a3ac5 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -263,8 +263,12 @@ Now, we are ready to backup this sample database. ### Prepare Backend +We are going to store our backed up data into a GCS bucket. At first, we need to create a secret with GCS credentials then we need to create a `Repository` crd. + **Create Storage Secret:** +Let's create a secret called `gcs-secret` with access credentials to our desired GCS bucket, + ```console $ echo -n 'changeit' > RESTIC_PASSWORD $ echo -n '' > GOOGLE_PROJECT_ID @@ -278,6 +282,8 @@ secret/gcs-secret created **Create Repository:** +Now, crete a `Respository` using this secret. Below is the YAML of Repository crd we are going to create, + ```yaml apiVersion: stash.appscode.com/v1alpha1 kind: Repository @@ -292,15 +298,23 @@ spec: storageSecretName: gcs-secret ``` +Let's create the `Repository` we have shown above, + ```console $ kubectl apply -f ./docs/examples/backup/repository.yaml repository.stash.appscode.com/gcs-repo created ``` +Now, we are ready to backup our database to our desired backend. + ### Backup +We have to create a `BackupConfiguration` targeting respective AppBinding crd of our desired database. Then Stash will create a CronJob to periodically backup the database. + **Create BackupConfiguration:** +Below is the YAML for `BackupConfiguration` crd to backup the `sample-postgres` database we have deployed earlier., + ```yaml apiVersion: stash.appscode.com/v1beta1 kind: BackupConfiguration @@ -323,12 +337,24 @@ spec: prune: true ``` +Here, + +- `spec.schedule` specifies that we want to backup the database at 5 minutes interval. +- `spec.task.name` specifies the name of the task crd that specifies the necessary Function and their order to backup PostgreSQL databse. +- `spec.target.ref` refers to the `AppBinding` crd that was created for `sample-postgres` database. + +Let's create the `BackupConfiguration` crd we have shown above, + ```console $ kubectl apply -f ./docs/examples/backup/backupconfiguration.yaml backupconfiguration.stash.appscode.com/sample-postgres-backup created ``` -**CronJob:** +**Verify CronJob:** + +If everything goes well, Stash will create a CronJob with the schedule specified in `spec.schedule` field of `BackupConfiguration` crd. + +Verify that the CronJob has been created using the following command, ```console $ kubectl get cronjob -n demo @@ -336,34 +362,53 @@ NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE sample-postgres-backup */5 * * * * False 0 61s ``` -**BackupSession:** +**Wait for BackupSession:** + +The `sample-postgres-backup` CronJob will trigger a backup on each schedule by creating a `BackpSession` crd. + +Wait for a schedule to appear. Run the following command to watch `BackupSession` crd, ```console -$ kubectl get backupsession -n demo +$ kubectl get backupsession -n demo -w NAME BACKUPCONFIGURATION PHASE AGE -sample-postgres-backup-1560350521 sample-postgres-backup Succeeded 88s +sample-postgres-backup-1560350521 sample-postgres-backup Running 5m19s +sample-postgres-backup-1560350521 sample-postgres-backup Succeeded 5m45s ``` +We can see above that the backup session has succeeded. Now, we will verify that the backed up data has stored in the backend. + **Verify Backup:** -Repository: +Once a backup is complete, Stash will update the repective `Repository` crd to reflect the backup. Check that the repository `gcs-repo` has been updated by the following command, ```console $ kubectl get repository -n demo gcs-repo NAME INTEGRITY SIZE SNAPSHOT-COUNT LAST-SUCCESSFUL-BACKUP AGE gcs-repo true 3.441 KiB 1 31s 17m ``` -Image: + +Now, if we navigate to the GCS bucket, we will see backed up data has been stored in `demo/postgres/sample-postgres` directory as specified by `spec.backend.gcs.prefix` field of Repository crd.
  Backup data in GCS Bucket
Fig: Backup data in GCS Bucket
+>Note: Stash keeps all the backed up data encrypted. So, data in the backend will not make any sense until they are decrypted. + ## Restore PostgreSQL +We will restored the database from the backup we have taken in previous section. We will deploy a new database and initialize it from the backup. + **Deploy Restored Database:** +Now, we have to deploy the restored database similarly as we have deployed the original `sample-psotgres` database. However, this time there will be following differences: + +- We have to use same secret that was used in the original database. We will specify it using `spec.databaseSecret` field. +- We have to specify `spec.init` section to tell KubeDB that we are going to use Stash to initialize this database from backup. KubeDB will keep the database phase to `Initializing` until Stash finish it's initialization. + +Below is the YAML for `Postgres` crd we are going deploy to initialize from backup, + ```yaml apiVersion: kubedb.com/v1alpha1 kind: Postgres @@ -388,18 +433,30 @@ spec: terminationPolicy: Delete ``` +Here, + +- `spec.init.stashRestoreSession.name` specifies the `RestoreSession` crd name that we are going to use to restore this database. + +Let's create the above database, + ```console $ kubectl apply -f ./docs/examples/restore/restored-postgres.yaml postgres.kubedb.com/restored-postgres created ``` +If you check the database status, you will see it is stuck in `Initializing` state. + ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE restored-postgres 11.2 Initializing 3m21s ``` -appbinding +**Create RestoreSession:** + +Now, we need to create a `RestoreSession` crd pointing to the AppBinding for this restored database. + +Check AppBinding has been created for the `restored-postgres` database using the following command, ```console $ kubectl get appbindings -n demo restored-postgres @@ -407,8 +464,6 @@ NAME AGE restored-postgres 9m59s ``` -RestoreSession: - ```yaml apiVersion: stash.appscode.com/v1beta1 kind: RestoreSession @@ -416,7 +471,7 @@ metadata: name: sample-postgres-restore namespace: demo labels: - kubedb.com/kind: Postgres + kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: name: pg-restore @@ -431,32 +486,49 @@ spec: - snapshots: [latest] ``` +Here, + +- `metadata.labels` specfies a `kubedb.com/kind: Postgres` label that is used by KubeDB to watch this `RestoreSession`. +- `spec.task.name` specifies the name of the `Task` crd that specifies the Functions and their execution order to restore a PostgreSQL database. +- `spec.repository.name` specifies the `Repository` crd that holds the backend information where our backed up data has been stored. +- `spec.target.ref` refers to the AppBinding crd for the `restored-postgres` databse. +- `spec.rules` specifies that we are restoring from latest backup snapshot of the database. + +> **Warning:** Label `kubedb.com/kind: Postgres` is mandatory if you are uisng KubeDB to deploy the databse. Otherwise, the database will stuck in `Initializing` state. + +Let's create the `RestoreSession` crd we have shown above, + ```console $ kubectl apply -f ./docs/examples/restore/restoresession.yaml restoresession.stash.appscode.com/sample-postgres-restore created ``` +Once, you have create the `RestoreSession` crd, Stash will create a job to restore. We can watch the `RestoreSession` phase to check if the restore process is succeeded or not. + +Run the follwoing command to watch `RestoreSession` phase, + ```console -$ kubectl get restoresession -n demo sample-postgres-restore +$ kubectl get restoresession -n demo sample-postgres-restore -w NAME REPOSITORY-NAME PHASE AGE +sample-postgres-restore gcs-repo Running 5s sample-postgres-restore gcs-repo Succeeded 43s ``` +So, we can see from the output of above command that restore process succeeded. + **Verify Restored Data:** +In this section, we will verify that the desired data has been restored successfully. We will connect to the database and check whether the table we had created in original database is restored or not. + +At first, check if the database has gone to `Running` state by the following command, + ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE restored-postgres 11.2 Running 2m16s ``` -Verify data: - -```console -$ kubectl get pods -n demo --selector="kubedb.com/name=restored-postgres" -NAME READY STATUS RESTARTS AGE -sample-postgres-0 1/1 Running 0 8m58s -``` +Now, find out the database pod by the following command, ```console $ kubectl get pods -n demo --selector="kubedb.com/name=restored-postgres" @@ -464,6 +536,8 @@ NAME READY STATUS RESTARTS AGE restored-postgres-0 1/1 Running 0 3m15s ``` +Now, exec into the database pod and list available tables, + ```console $ kubectl exec -it -n demo restored-postgres-0 sh # login as "postgres" superuser. @@ -502,8 +576,12 @@ postgres=# \q / # exit ``` +So, from the above output, we can see the table `company` that we had created in the original database `sample-postgres` is restored in the restored database `restored-postgres`. + ## Cleanup +To cleanup the Kubernetes resources created by this tutorial, run: + ```console kubectl delete restoresession -n demo sample-postgres-restore kubectl delete pg -n demo restored-postgres From d3068a46e5fd967ec1c16dfd6874063099419b94 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Sun, 16 Jun 2019 14:13:52 +0600 Subject: [PATCH 06/25] Add front matter + refactor --- docs/postgres.md | 81 +++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/docs/postgres.md b/docs/postgres.md index fd07a3ac5..19e7f3f28 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -1,7 +1,20 @@ +--- +title: Backup PostgreSQL | Stash +description: Backup PostgreSQL database using Stash +menu: + product_stash_0.8.3: + identifier: database-postgres + name: PostgreSQL + parent: database + weight: 20 +product_name: stash +menu_name: product_stash_0.8.3 +section_menu_id: guides +--- # Backup and Restore PostgreSQL database using Stash -Stash supports backup and restore PostgreSQL database. This guide will show you how you can backup/restore your PostgreSQL database with Stash. +Stash supports backup and restores PostgreSQL database. This guide will show you how you can backup and restore your PostgreSQL database with Stash. ## Before You Begin @@ -11,9 +24,8 @@ Stash supports backup and restore PostgreSQL database. This guide will show you - Install [KubeDB](https://kubedb.com)(`Optional`) in your cluster following the steps [here](https://kubedb.com/docs/0.12.0/setup/install/). -- If you are not familiar with how Stash backup and restore databases, please check following guides: - - [How Stash backup databases](https://appscode.com/products/stash/0.8.3/guides/databases/backup/). - - [How Stash restore databases from a backup](https://appscode.com/products/stash/0.8.3/guides/databases/restore/). +- If you are not familiar with how Stash backup and restore databases, please check the following guide: + - [How Stash backup and restore databases](https://appscode.com/products/stash/0.8.3/guides/databases/overview/). You have to be familiar with following custom resources: @@ -34,7 +46,7 @@ namespace/demo created ## Install Postgres plugin for Stash -At first, we have to install Postgres plugin `postgres-stash` for Stash. This plugin creates necessary `Function` and `Task` definition which is used by Stash to backup/restore PostgreSQL database. We are going to use [Helm](https://helm.sh/) to install `postgres-stash` chart. +At first, we have to install Postgres plugin `postgres-stash` for Stash. This plugin creates necessary `Function` and `Task` definition which is used by Stash to backup or restore a PostgreSQL database. We are going to use [Helm](https://helm.sh/) to install `postgres-stash` chart. Let's install `postgres-stash` chart, @@ -67,11 +79,11 @@ Now, Stash is ready to backup PostgreSQL database. ## Backup PostgreSQL -This section will demonstrate how to backup PostgreSQL databse. We are going to use [KubeDB](https://kubedb.com) to deploy a sample database. You can deploy your database using any methond you want. We are using `KubeDB` because it automates some tasks that you have to do manually otherwise. +This section will demonstrate how to backup PostgreSQL databse. We are going to use [KubeDB](https://kubedb.com) to deploy a sample database. You can deploy your database using any method you want. We are using `KubeDB` because it automates some tasks that you have to do manually otherwise. ### Deploy Sample PosgreSQL Database -Let's deploy a sample PostgreSQL database and inset some data into it. +Let's deploy a sample PostgreSQL database and insert some data into it. **Create Postgres CRD:** @@ -103,7 +115,7 @@ $ kubectl apply -f ./docs/examples/backup/postgres.yaml postgres.kubedb.com/sample-postgres created ``` -KubeDB will deploy a PostgreSQL database according to the above specification. It will also create necessary secrets, services to access the database. +KubeDB will deploy a PostgreSQL database according to the above specification. It will also create the necessary secrets and services to access the database. Let's check if the database is ready to use, @@ -113,7 +125,7 @@ NAME VERSION STATUS AGE sample-postgres 11.2 Running 3m11s ``` -The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using follwoing commands, +The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using the following commands, ```console $ kubectl get secret -n demo -l=kubedb.com/name=sample-postgres @@ -126,7 +138,7 @@ sample-postgres ClusterIP 10.106.147.155 5432/TCP sample-postgres-replicas ClusterIP 10.96.231.122 5432/TCP 22h ``` -Here, we have to use service `sample-postgres` and secret `sample-postgres-auth` to connect with the database. KubeDB creates an [AppBinding](https://appscode.com/products/stash/0.8.3/concepts/crds/appbinding/) crd that holds these necessary information to connect with the database. +Here, we have to use service `sample-postgres` and secret `sample-postgres-auth` to connect with the database. KubeDB creates an [AppBinding](https://appscode.com/products/stash/0.8.3/concepts/crds/appbinding/) crd that holds the necessary information to connect with the database. **Verify AppBinding:** @@ -180,14 +192,14 @@ spec: type: kubedb.com/postgres ``` -Stash uses the `AppBinding` crd to connect with the target database. It requires following two field to set in AppBinding's `Spec` section. +Stash uses the `AppBinding` crd to connect with the target database. It requires the following two fields to set in AppBinding's `Spec` section. -- `spec.clientConfig.service.name` specifies the name of the service that connect to the database. -- `spec.secret` specifies name of the secret that holds necessary credentials to access the database. +- `spec.clientConfig.service.name` specifies the name of the service that connects to the database. +- `spec.secret` specifies the name of the secret that holds necessary credentials to access the database. **Creating AppBinding Manually:** -If you deploy PostgreSQL database without KubeDB, you have to create the AppBinding crd manually in the same namespace as the service and secret. +If you deploy PostgreSQL database without KubeDB, you have to create the AppBinding crd manually in the same namespace as the service and secret of the database. The following YAML shows a minimal AppBinding specification that you have to create if you deploy PostgreSQL database without KubeDB. @@ -207,7 +219,7 @@ spec: **Insert Sample Data:** -Now, we will exec into the database pod and create some sample data. At first find out the database pod using the following command, +Now, we will exec into the database pod and create some sample data. At first, find out the database pod using the following command, ```console $ kubectl get pods -n demo --selector="kubedb.com/name=sample-postgres" @@ -263,7 +275,7 @@ Now, we are ready to backup this sample database. ### Prepare Backend -We are going to store our backed up data into a GCS bucket. At first, we need to create a secret with GCS credentials then we need to create a `Repository` crd. +We are going to store our backed up data into a GCS bucket. At first, we need to create a secret with GCS credentials then we need to create a `Repository` crd. If you want to use a different backend, please read the respective backend configuration doc from [here](https://appscode.com/products/stash/0.8.3/guides/backends/overview/). **Create Storage Secret:** @@ -340,7 +352,7 @@ spec: Here, - `spec.schedule` specifies that we want to backup the database at 5 minutes interval. -- `spec.task.name` specifies the name of the task crd that specifies the necessary Function and their order to backup PostgreSQL databse. +- `spec.task.name` specifies the name of the task crd that specifies the necessary Function and their execution order to backup a PostgreSQL databse. - `spec.target.ref` refers to the `AppBinding` crd that was created for `sample-postgres` database. Let's create the `BackupConfiguration` crd we have shown above, @@ -375,11 +387,11 @@ sample-postgres-backup-1560350521 sample-postgres-backup Running 5m19s sample-postgres-backup-1560350521 sample-postgres-backup Succeeded 5m45s ``` -We can see above that the backup session has succeeded. Now, we will verify that the backed up data has stored in the backend. +We can see above that the backup session has succeeded. Now, we will verify that the backed up data has been stored in the backend. **Verify Backup:** -Once a backup is complete, Stash will update the repective `Repository` crd to reflect the backup. Check that the repository `gcs-repo` has been updated by the following command, +Once a backup is complete, Stash will update the respective `Repository` crd to reflect the backup. Check that the repository `gcs-repo` has been updated by the following command, ```console $ kubectl get repository -n demo gcs-repo @@ -398,14 +410,14 @@ Now, if we navigate to the GCS bucket, we will see backed up data has been store ## Restore PostgreSQL -We will restored the database from the backup we have taken in previous section. We will deploy a new database and initialize it from the backup. +We will restore the database from the backup we have taken in the previous section. We will deploy a new database and initialize it from the backup. **Deploy Restored Database:** -Now, we have to deploy the restored database similarly as we have deployed the original `sample-psotgres` database. However, this time there will be following differences: +Now, we have to deploy the restored database similarly as we have deployed the original `sample-psotgres` database. However, this time there will be the following differences: -- We have to use same secret that was used in the original database. We will specify it using `spec.databaseSecret` field. -- We have to specify `spec.init` section to tell KubeDB that we are going to use Stash to initialize this database from backup. KubeDB will keep the database phase to `Initializing` until Stash finish it's initialization. +- We have to use the same secret that was used in the original database. We will specify it using `spec.databaseSecret` field. +- We have to specify `spec.init` section to tell KubeDB that we are going to use Stash to initialize this database from backup. KubeDB will keep the database phase to `Initializing` until Stash finishes its initialization. Below is the YAML for `Postgres` crd we are going deploy to initialize from backup, @@ -464,6 +476,10 @@ NAME AGE restored-postgres 9m59s ``` +>If you are not using KubeDB to deploy database, create the AppBinding manually. + +Below is the YAML for the `RestoreSession` crd that we are going to create to restore backed up data into `restored-postgres` database. + ```yaml apiVersion: stash.appscode.com/v1beta1 kind: RestoreSession @@ -488,13 +504,13 @@ spec: Here, -- `metadata.labels` specfies a `kubedb.com/kind: Postgres` label that is used by KubeDB to watch this `RestoreSession`. +- `metadata.labels` specifies a `kubedb.com/kind: Postgres` label that is used by KubeDB to watch this `RestoreSession`. - `spec.task.name` specifies the name of the `Task` crd that specifies the Functions and their execution order to restore a PostgreSQL database. - `spec.repository.name` specifies the `Repository` crd that holds the backend information where our backed up data has been stored. - `spec.target.ref` refers to the AppBinding crd for the `restored-postgres` databse. -- `spec.rules` specifies that we are restoring from latest backup snapshot of the database. +- `spec.rules` specifies that we are restoring from the latest backup snapshot of the database. -> **Warning:** Label `kubedb.com/kind: Postgres` is mandatory if you are uisng KubeDB to deploy the databse. Otherwise, the database will stuck in `Initializing` state. +> **Warning:** Label `kubedb.com/kind: Postgres` is mandatory if you are uisng KubeDB to deploy the databse. Otherwise, the database will be stuck in `Initializing` state. Let's create the `RestoreSession` crd we have shown above, @@ -503,9 +519,9 @@ $ kubectl apply -f ./docs/examples/restore/restoresession.yaml restoresession.stash.appscode.com/sample-postgres-restore created ``` -Once, you have create the `RestoreSession` crd, Stash will create a job to restore. We can watch the `RestoreSession` phase to check if the restore process is succeeded or not. +Once, you have created the `RestoreSession` crd, Stash will create a job to restore. We can watch the `RestoreSession` phase to check if the restore process is succeeded or not. -Run the follwoing command to watch `RestoreSession` phase, +Run the following command to watch `RestoreSession` phase, ```console $ kubectl get restoresession -n demo sample-postgres-restore -w @@ -514,13 +530,13 @@ sample-postgres-restore gcs-repo Running 5s sample-postgres-restore gcs-repo Succeeded 43s ``` -So, we can see from the output of above command that restore process succeeded. +So, we can see from the output of the above command that the restore process succeeded. **Verify Restored Data:** -In this section, we will verify that the desired data has been restored successfully. We will connect to the database and check whether the table we had created in original database is restored or not. +In this section, we will verify that the desired data has been restored successfully. We will connect to the database and check whether the table we had created in the original database is restored or not. -At first, check if the database has gone to `Running` state by the following command, +At first, check if the database has gone into `Running` state by the following command, ```console $ kubectl get pg -n demo restored-postgres @@ -561,7 +577,7 @@ postgres=# \l postgres=# \c postgres You are now connected to database "postgres" as user "postgres". -# check the table we had created in original database has been restored here +# check the table we had created in the original database has been restored here postgres=# \d List of relations Schema | Name | Type | Owner @@ -584,6 +600,7 @@ To cleanup the Kubernetes resources created by this tutorial, run: ```console kubectl delete restoresession -n demo sample-postgres-restore +kubectl delete backupconfiguration -n demo sample-postgres-backup kubectl delete pg -n demo restored-postgres kubectl delete pg -n demo sample-postgres ``` From 71009ea0ffc82484ee96203fae6f08f2dc975c2c Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Sun, 16 Jun 2019 18:01:39 +0600 Subject: [PATCH 07/25] add chart version in task and function name --- chart/postgres-stash/templates/pg-backup-function.yaml | 2 +- chart/postgres-stash/templates/pg-backup-task.yaml | 2 +- chart/postgres-stash/templates/pg-restore-function.yaml | 2 +- chart/postgres-stash/templates/pg-restore-task.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chart/postgres-stash/templates/pg-backup-function.yaml b/chart/postgres-stash/templates/pg-backup-function.yaml index ff61de530..363a85886 100644 --- a/chart/postgres-stash/templates/pg-backup-function.yaml +++ b/chart/postgres-stash/templates/pg-backup-function.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Function metadata: - name: pg-backup + name: pg-backup-{{ .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: diff --git a/chart/postgres-stash/templates/pg-backup-task.yaml b/chart/postgres-stash/templates/pg-backup-task.yaml index f2c94004c..395a3177c 100644 --- a/chart/postgres-stash/templates/pg-backup-task.yaml +++ b/chart/postgres-stash/templates/pg-backup-task.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Task metadata: - name: pg-backup + name: pg-backup-{{ .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: diff --git a/chart/postgres-stash/templates/pg-restore-function.yaml b/chart/postgres-stash/templates/pg-restore-function.yaml index 2c5d3339b..ad082e417 100644 --- a/chart/postgres-stash/templates/pg-restore-function.yaml +++ b/chart/postgres-stash/templates/pg-restore-function.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Function metadata: - name: pg-restore + name: pg-restore-{{ .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: diff --git a/chart/postgres-stash/templates/pg-restore-task.yaml b/chart/postgres-stash/templates/pg-restore-task.yaml index 2758eba11..c3ec7d2fa 100644 --- a/chart/postgres-stash/templates/pg-restore-task.yaml +++ b/chart/postgres-stash/templates/pg-restore-task.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Task metadata: - name: pg-restore + name: pg-restore-{{ .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: From 9fe0b49e74bcd1c21757125e589ae00fa316588b Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Mon, 17 Jun 2019 16:14:34 +0600 Subject: [PATCH 08/25] Renamed chart version to 11.x --- chart/postgres-stash/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 3fbaf3744..6b799ad84 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'Postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash' name: postgres-stash -version: 11.2 -appVersion: 11.2 +version: 11.x +appVersion: 11.x home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: From 02d22b297bac92f697364b0cabfd1d7c21cacca6 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Mon, 17 Jun 2019 16:48:39 +0600 Subject: [PATCH 09/25] Update chart and docs for 10.x --- Makefile | 4 ++-- chart/postgres-stash/Chart.yaml | 4 ++-- chart/postgres-stash/values.yaml | 2 +- docs/examples/backup/postgres.yaml | 2 +- docs/examples/restore/restored-postgres.yaml | 2 +- docs/postgres.md | 16 ++++++++-------- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 0542dd085..7acaa2e49 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= postgres:11.2-alpine -BASEIMAGE_DBG ?= postgres:11.2 +BASEIMAGE_PROD ?= postgres:10.6-alpine +BASEIMAGE_DBG ?= postgres:10.6 IMAGE := $(REGISTRY)/$(BIN) VERSION_PROD := $(VERSION) diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 6b799ad84..9c04d9b01 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'Postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash' name: postgres-stash -version: 11.x -appVersion: 11.x +version: 10.x +appVersion: 10.x home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index 99ce0aa84..fe3d9ebaf 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -4,7 +4,7 @@ docker: registry: appscode image: postgres-stash - tag: 11.2 + tag: 10.6 # optional argument to send pgdump or psql command pgArgs: "" diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml index a84a3e713..e6337a44c 100644 --- a/docs/examples/backup/postgres.yaml +++ b/docs/examples/backup/postgres.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "11.2" + version: "10.6-v2" storageType: Durable storage: storageClassName: "standard" diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml index d4f35ad9a..ceecfd76c 100644 --- a/docs/examples/restore/restored-postgres.yaml +++ b/docs/examples/restore/restored-postgres.yaml @@ -4,7 +4,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "11.2" + version: "10.6-v2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database diff --git a/docs/postgres.md b/docs/postgres.md index 19e7f3f28..06c9743ce 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -96,7 +96,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "11.2" + version: "10.6-v2" storageType: Durable storage: storageClassName: "standard" @@ -122,7 +122,7 @@ Let's check if the database is ready to use, ```console $ kubectl get pg -n demo sample-postgres NAME VERSION STATUS AGE -sample-postgres 11.2 Running 3m11s +sample-postgres 10.6-v2 Running 3m11s ``` The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using the following commands, @@ -168,7 +168,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "11.2" + app.kubernetes.io/version: "10.6-v2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... @@ -233,7 +233,7 @@ Now, let's exec into the pod and create a table, $ kubectl exec -it -n demo sample-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (11.2) +psql (10.6) Type "help" for help. # list available databases @@ -428,7 +428,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "11.2" + version: "10.6-v2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database @@ -461,7 +461,7 @@ If you check the database status, you will see it is stuck in `Initializing` sta ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 11.2 Initializing 3m21s +restored-postgres 10.6-v2 Initializing 3m21s ``` **Create RestoreSession:** @@ -541,7 +541,7 @@ At first, check if the database has gone into `Running` state by the following c ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 11.2 Running 2m16s +restored-postgres 10.6-v2 Running 2m16s ``` Now, find out the database pod by the following command, @@ -558,7 +558,7 @@ Now, exec into the database pod and list available tables, $ kubectl exec -it -n demo restored-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (11.2) +psql (10.6) Type "help" for help. # list available databases From ad7da6323b3f9106b3a481836ccb9cfe2a679f17 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Mon, 17 Jun 2019 17:18:12 +0600 Subject: [PATCH 10/25] Update chart and doc for version 9.x --- chart/README.md | 2 +- chart/postgres-stash/Chart.yaml | 4 ++-- chart/postgres-stash/values.yaml | 2 +- docs/examples/backup/postgres.yaml | 2 +- docs/examples/restore/restored-postgres.yaml | 2 +- docs/postgres.md | 16 ++++++++-------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/chart/README.md b/chart/README.md index 0e943058a..0cfb3d90d 100644 --- a/chart/README.md +++ b/chart/README.md @@ -48,7 +48,7 @@ The following table lists the configurable parameters of the Postgre-stash chart | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | `docker.registry` | Docker registry used to pull respective images | `appscode` | | `docker.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.6` | +| `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.x` | | `pgArgs` | Optional arguments to pass to `psql`/`pgdump` command | | | `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | | `metrics.labels` | Optional comma separated labels to add the Prometheus metrics | | diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 9c04d9b01..2fc2defea 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'Postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash' name: postgres-stash -version: 10.x -appVersion: 10.x +version: 9.x +appVersion: 9.x home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index fe3d9ebaf..fb949d74d 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -4,7 +4,7 @@ docker: registry: appscode image: postgres-stash - tag: 10.6 + tag: 9.x # optional argument to send pgdump or psql command pgArgs: "" diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml index e6337a44c..28d22bd12 100644 --- a/docs/examples/backup/postgres.yaml +++ b/docs/examples/backup/postgres.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "10.6-v2" + version: "9.6.7-v4" storageType: Durable storage: storageClassName: "standard" diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml index ceecfd76c..4c94935d7 100644 --- a/docs/examples/restore/restored-postgres.yaml +++ b/docs/examples/restore/restored-postgres.yaml @@ -4,7 +4,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "10.6-v2" + version: "9.6.7-v4" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database diff --git a/docs/postgres.md b/docs/postgres.md index 06c9743ce..7c8c81024 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -96,7 +96,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "10.6-v2" + version: "9.6.7-v4" storageType: Durable storage: storageClassName: "standard" @@ -122,7 +122,7 @@ Let's check if the database is ready to use, ```console $ kubectl get pg -n demo sample-postgres NAME VERSION STATUS AGE -sample-postgres 10.6-v2 Running 3m11s +sample-postgres 9.6.7-v4 Running 3m11s ``` The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using the following commands, @@ -168,7 +168,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "10.6-v2" + app.kubernetes.io/version: "9.6.7-v4" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... @@ -233,7 +233,7 @@ Now, let's exec into the pod and create a table, $ kubectl exec -it -n demo sample-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (10.6) +psql (9.6.7) Type "help" for help. # list available databases @@ -428,7 +428,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "10.6-v2" + version: "9.6.7-v4" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database @@ -461,7 +461,7 @@ If you check the database status, you will see it is stuck in `Initializing` sta ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 10.6-v2 Initializing 3m21s +restored-postgres 9.6.7-v4 Initializing 3m21s ``` **Create RestoreSession:** @@ -541,7 +541,7 @@ At first, check if the database has gone into `Running` state by the following c ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 10.6-v2 Running 2m16s +restored-postgres 9.6.7-v4 Running 2m16s ``` Now, find out the database pod by the following command, @@ -558,7 +558,7 @@ Now, exec into the database pod and list available tables, $ kubectl exec -it -n demo restored-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (10.6) +psql (9.6.7) Type "help" for help. # list available databases From 04468c831c90360d02cdff9ec44ac5f9cdea53ac Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Tue, 18 Jun 2019 10:02:55 +0600 Subject: [PATCH 11/25] use verison 9 instead of 9.x --- chart/postgres-stash/Chart.yaml | 4 ++-- chart/postgres-stash/values.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 2fc2defea..28f918e31 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'Postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash' name: postgres-stash -version: 9.x -appVersion: 9.x +version: 9 +appVersion: 9 home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index fb949d74d..62f8958a4 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -4,7 +4,7 @@ docker: registry: appscode image: postgres-stash - tag: 9.x + tag: 9 # optional argument to send pgdump or psql command pgArgs: "" From 02f7e482fda92a1044c7f57179b7273cd1b58e7b Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Tue, 18 Jun 2019 14:36:04 +0600 Subject: [PATCH 12/25] Make configurable parameters global so that parent chart can overwite them --- chart/README.md | 25 +++++++++++-------- .../templates/pg-backup-function.yaml | 10 ++++---- .../templates/pg-restore-function.yaml | 10 ++++---- chart/postgres-stash/values.yaml | 20 +++++++++------ 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/chart/README.md b/chart/README.md index 0cfb3d90d..3968ec426 100644 --- a/chart/README.md +++ b/chart/README.md @@ -44,25 +44,28 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the Postgre-stash chart and their default values. -| Parameter | Description | Default | -| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| `docker.registry` | Docker registry used to pull respective images | `appscode` | -| `docker.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.x` | -| `pgArgs` | Optional arguments to pass to `psql`/`pgdump` command | | -| `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | -| `metrics.labels` | Optional comma separated labels to add the Prometheus metrics | | +| Parameter | Description | Default | +| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| `global.registry` | Docker registry used to pull respective images | `appscode` | +| `global.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | +| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.x` | +| `global.backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | +| `global.restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | +| `global.metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | +| `global.metrics.labels` | Optional comma separated labels to add the Prometheus metrics | | + +> We have declared all the configurable parameters as global parameter so that the parent chart can overwrite them. Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: ```console -helm install --name postgres-stash --set metrics.enabled=false appscode/postgres-stash +helm install --name postgres-stash --set global.metrics.enabled=false appscode/postgres-stash ``` -**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `metrics.labels`. +**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `global.metrics.labels`. ```console - helm install chart/postgres-stash --set metrics.labels="k1=v1\,k2=v2" + helm install chart/postgres-stash --set global.metrics.labels="k1=v1\,k2=v2" ``` diff --git a/chart/postgres-stash/templates/pg-backup-function.yaml b/chart/postgres-stash/templates/pg-backup-function.yaml index 363a85886..f0f05bd9a 100644 --- a/chart/postgres-stash/templates/pg-backup-function.yaml +++ b/chart/postgres-stash/templates/pg-backup-function.yaml @@ -5,7 +5,7 @@ metadata: labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: - image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{- .Values.docker.tag }} + image: {{ .Values.global.registry }}/{{ .Values.global.image }}:{{- .Values.global.tag }} args: - backup-pg # setup information @@ -19,7 +19,7 @@ spec: - --enable-cache=${ENABLE_CACHE:=true} - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit - --hostname=${HOSTNAME:=} - - --pg-args=${pgArgs:={{ .Values.pgArgs }}} # optional arguments pass to pgdump command + - --pg-args=${pgArgs:={{ .Values.global.backup.pgArgs }}} # optional arguments pass to pgdump command # target information - --namespace=${NAMESPACE:=default} - --app-binding=${TARGET_NAME:=} @@ -35,10 +35,10 @@ spec: - --retention-dry-run=${RETENTION_DRY_RUN:=false} # output & metric information - --output-dir=${outputDir:=} - - --metrics-enabled={{ .Values.metrics.enabled }} + - --metrics-enabled={{ .Values.global.metrics.enabled }} - --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=} - {{- if .Values.metrics.labels }} - - --metrics-labels={{ .Values.metrics.labels | quote }} + {{- if .Values.global.metrics.labels }} + - --metrics-labels={{ .Values.global.metrics.labels | quote }} {{- end }} volumeMounts: - name: ${secretVolume} diff --git a/chart/postgres-stash/templates/pg-restore-function.yaml b/chart/postgres-stash/templates/pg-restore-function.yaml index ad082e417..21f494834 100644 --- a/chart/postgres-stash/templates/pg-restore-function.yaml +++ b/chart/postgres-stash/templates/pg-restore-function.yaml @@ -5,7 +5,7 @@ metadata: labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: - image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{ .Values.docker.tag }} + image: {{ .Values.global.registry }}/{{ .Values.global.image }}:{{ .Values.global.tag }} args: - restore-pg # setup information @@ -19,17 +19,17 @@ spec: - --enable-cache=${ENABLE_CACHE:=true} - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit - --hostname=${HOSTNAME:=} - - --pg-args=${pgArgs:={{ .Values.pgArgs }}} # optional arguments pass to pgdump command + - --pg-args=${pgArgs:={{ .Values.global.restore.pgArgs }}} # optional arguments pass to pgdump command # target information - --namespace=${NAMESPACE:=default} - --app-binding=${TARGET_NAME:=} - --snapshot=${RESTORE_SNAPSHOTS:=} # output & metric information - --output-dir=${outputDir:=} - - --metrics-enabled={{ .Values.metrics.enabled }} + - --metrics-enabled={{ .Values.global.metrics.enabled }} - --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=} - {{- if .Values.metrics.labels }} - - --metrics-labels={{ .Values.metrics.labels | quote }} + {{- if .Values.global.metrics.labels }} + - --metrics-labels={{ .Values.global.metrics.labels | quote }} {{- end }} volumeMounts: - name: ${secretVolume} diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index 62f8958a4..2181df185 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -1,14 +1,20 @@ # Default values for postgres-stash. # This is a YAML-formatted file. # Declare variables to be passed into your templates. -docker: + +# we are declaring these values as global so that parent chart can overwrite them +global: registry: appscode image: postgres-stash tag: 9 -# optional argument to send pgdump or psql command -pgArgs: "" -# default values for prometheus metrics -metrics: - enabled: true - labels: [] + # optional argument to send pgdump or psql command + backup: + pgArgs: "" + restore: + pgArgs: "" + + # default values for prometheus metrics + metrics: + enabled: true + labels: [] From d8f853a8771cd5ce1d19869655f9d3b3ac3b460f Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 19 Jun 2019 15:22:50 +0600 Subject: [PATCH 13/25] Add script installation process --- hack/setup.sh | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100755 hack/setup.sh diff --git a/hack/setup.sh b/hack/setup.sh new file mode 100755 index 000000000..96b60c4ad --- /dev/null +++ b/hack/setup.sh @@ -0,0 +1,195 @@ +#!/bin/bash +set -eou pipefail + +OS="" +ARCH="" +DOWNLOAD_URL="" +DOWNLOAD_DIR="" +TEMP_DIRS=() + +HELM="" +CHART_NAME="postgres-stash" +CHART_LOCATION="chart" + +APPSCODE_ENV=${APPSCODE_ENV:-prod} +DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} +IMAGE_TAG=9 + +BACKUP_ARGS="" +RESTORE_ARGS="" + +ENABLE_PROMETHEUS_METRICS=true +METRICS_LABELS="" + +UNINSTALL=0 + +function cleanup() { + # remove temporary directories + for dir in "${TEMP_DIRS[@]}"; do + rm -rf "${dir}" + done +} + +# detect operating system +function detectOS() { + OS=$(echo $(uname) | tr '[:upper:]' '[:lower:]') + + case "$OS" in + # Minimalist GNU for Windows + cygwin* | mingw* | msys*) OS='windows' ;; + esac +} + +# detect machine architecture +function detectArch() { + ARCH=$(uname -m) + case $ARCH in + armv5*) ARCH="armv5" ;; + armv6*) ARCH="armv6" ;; + armv7*) ARCH="arm" ;; + aarch64) ARCH="arm64" ;; + x86) ARCH="386" ;; + x86_64) ARCH="amd64" ;; + i686) ARCH="386" ;; + i386) ARCH="386" ;; + esac +} + +detectOS +detectArch + +# download file pointed by DOWNLOAD_URL variable +# store download file to the directory pointed by DOWNLOAD_DIR variable +# you have to sent the output file name as argument. i.e. downloadFile myfile.tar.gz +function downloadFile() { + if curl --output /dev/null --silent --head --fail "${DOWNLOAD_URL}"; then + curl -fsSL ${DOWNLOAD_URL} -o ${DOWNLOAD_DIR}/$1 + else + echo "File does not exist" + exit 1 + fi +} + +trap cleanup EXIT + +show_help() { + echo "install.sh - install postgres-stash catalog for stash" + echo " " + echo "install.sh [options]" + echo " " + echo "options:" + echo "-h, --help show brief help" + echo " --docker-registry docker registry used to pull postgres-stash images (default: appscode)" + echo " --image-tag tag to use to pull postgres-stash docker image" + echo " --backup-args optional arguments to pass to pgdump command during backup" + echo " --restore-args optional arguments to pass to psql command during restore" + echo " --metrics-enabled specify whether to send prometheus metrics during backup or restore (default: true)" + echo " --metrics-labels labels to apply to prometheus metrics for backup or restore process (format: k1=v1,k2=v2)" + echo " --uninstall uninstall postgres-stash catalog" +} + +while test $# -gt 0; do + case "$1" in + -h | --help) + show_help + exit 0 + ;; + --docker-registry*) + DOCKER_REGISTRY=$(echo $1 | sed -e 's/^[^=]*=//g') + shift + ;; + --image-tag*) + IMAGE_TAG=$(echo $1 | sed -e 's/^[^=]*=//g') + shift + ;; + --backup-args*) + BACKUP_ARGS=$(echo $1 | sed -e 's/^[^=]*=//g') + shift + ;; + --restore-args*) + RESTORE_ARGS=$(echo $1 | sed -e 's/^[^=]*=//g') + shift + ;; + --metrics-enabled*) + val=$(echo $1 | sed -e 's/^[^=]*=//g') + if [ "$val" = "false" ]; then + ENABLE_PROMETHEUS_METRICS=false + fi + shift + ;; + --metrics-labels*) + METRICS_LABELS=$(echo $1 | sed -e 's/^[^=]*=//g') + shift + ;; + --uninstall) + UNINSTALL=1 + shift + ;; + *) + echo "unknown flag: $1" + echo " " + show_help + exit 1 + ;; + esac +done + +# Download helm if already not installed +if [ -x "$(command -v helm)" ]; then + HELM=helm +else + echo "Helm is not installed!. Downloading Helm." + ARTIFACT="https://get.helm.sh" + HELM_VERSION="v2.14.1" + HELM_BIN=helm + HELM_DIST=${HELM_BIN}-${HELM_VERSION}-${OS}-${ARCH}.tar.gz + + case "$OS" in + cygwin* | mingw* | msys*) + HELM_BIN=${HELM_BIN}.exe + ;; + esac + + DOWNLOAD_URL=${ARTIFACT}/${HELM_DIST} + DOWNLOAD_DIR="$(mktemp -dt helm-XXXXXX)" + TEMP_DIRS+=($DOWNLOAD_DIR) + + downloadFile ${HELM_DIST} + + tar xf ${DOWNLOAD_DIR}/${HELM_DIST} -C ${DOWNLOAD_DIR} + HELM=${DOWNLOAD_DIR}/${OS}-${ARCH}/${HELM_BIN} + chmod +x $HELM +fi + +if [[ "$APPSCODE_ENV" == "dev" ]]; then + CHART_LOCATION="chart" +else + # download chart from remove repository and extract into a temporary directory + CHART_LOCATION="$(mktemp -dt appscode-XXXXXX)" + TEMP_DIRS+=(${CHART_LOCATION}) + TEMP_INSTALLER_REPO="${CHART_NAME}-installer" + $HELM repo add "${TEMP_INSTALLER_REPO}" "https://charts.appscode.com/stable" + $HELM fetch --untar --untardir ${CHART_LOCATION} "${TEMP_INSTALLER_REPO}/${CHART_NAME}" + $HELM repo remove "${TEMP_INSTALLER_REPO}" +fi + +if [ "$UNINSTALL" -eq 1 ]; then + $HELM template ${CHART_LOCATION}/${CHART_NAME} \ + | kubectl delete -f - + + echo " " + echo "Successfully uninstalled postgres-stash catalog" +else +# render the helm template and apply the resulting YAML +$HELM template ${CHART_LOCATION}/${CHART_NAME} \ + --set global.registry=${DOCKER_REGISTRY} \ + --set global.tag=${IMAGE_TAG} \ + --set global.backup.pgArgs=${BACKUP_ARGS} \ + --set global.restore.pgArgs=${RESTORE_ARGS} \ + --set global.metrics.enabled=${ENABLE_PROMETHEUS_METRICS} \ + --set global.metrics.labels=${METRICS_LABELS} \ +| kubectl apply -f - + +echo " " +echo "Successfully installed postgres-stash catalog" +fi From bb80a4b21dd3ca3184028be60b56c82d3e08c916 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 19 Jun 2019 16:35:09 +0600 Subject: [PATCH 14/25] Update documentation for PostgreSQL 9.6 --- README.md | 36 +++++++++- chart/README.md | 36 ++++++---- chart/postgres-stash/Chart.yaml | 6 +- chart/postgres-stash/values.yaml | 2 +- docs/examples/backup/appbinding.yaml | 2 +- docs/examples/backup/backupconfiguration.yaml | 2 +- docs/examples/restore/restoresession.yaml | 2 +- docs/postgres.md | 65 +++++++++++++------ hack/setup.sh | 4 +- 9 files changed, 110 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 10444b2ec..38b0ea4bf 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,45 @@ [![Twitter](https://img.shields.io/twitter/follow/appscodehq.svg?style=social&logo=twitter&label=Follow)](https://twitter.com/intent/follow?screen_name=AppsCodeHQ) # Postgres + Postgres backup and restore plugin for [Stash by AppsCode](https://appscode.com/products/stash). ---- +## Install + +Install PostgreSQL 9.6 backup or restore plugin for Stash as below. + +**Chart:** + +```console +helm repo add appscode https://charts.appscode.com/stable/ +helm repo update +helm install appscode/postgres-stash --name=postgres-stash-9.6 --version=9.6 +``` + +**Script:** + +```console +curl -fsSL https://github.com/stashed/postgres/raw/9.6/hack/setup.sh | bash +``` -**Stash binaries collects anonymous usage statistics to help us learn how the software is being used and how we can improve it. To disable stats collection, run the operator with the flag** `--enable-analytics=false`. +## Uninstall ---- +Uninstall PostgreSQL 9.6 backup or restore plugin for Stash as below. + +**Chart:** + +```console +helm delete postgres-stash-9.6 +``` + +**Script:** + +```console +curl -fsSL https://github.com/stashed/postgres/raw/9.6/hack/setup.sh | bash -s -- --uninstall +``` ## Support + We use Slack for public discussions. To chit chat with us or the rest of the community, join us in the [AppsCode Slack team](https://appscode.slack.com/messages/C8NCX6N23/details/) channel `#stash`. To sign up, use our [Slack inviter](https://slack.appscode.com/). If you have found a bug with Stash or want to request for new features, please [file an issue](https://github.com/stashed/stash/issues/new). diff --git a/chart/README.md b/chart/README.md index 3968ec426..146ae4260 100644 --- a/chart/README.md +++ b/chart/README.md @@ -1,18 +1,18 @@ # Postgres-stash -[Postgres-stash by AppsCode](https://github.com/stashed/postgres-stash) - PostgreSQL database backup/restore plugin for [Stash](https://github.com/stashed/). +[postgres-stash by AppsCode](https://github.com/stashed/postgres-stash) - PostgreSQL database backup/restore plugin for [Stash](https://github.com/stashed/). ## TL;DR; ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name postgres-stash +helm install appscode/postgres-stash --name=postgres-stash-9.6 --version=9.6 ``` ## Introduction -This chart installs necessary `Function` and `Task` crd to backup/restore PostgreSQL database using Stash. +This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 9.6 using Stash. ## Prerequisites @@ -20,39 +20,49 @@ This chart installs necessary `Function` and `Task` crd to backup/restore Postgr ## Installing the Chart -To install the chart with the release name `postgres-stash`: +- Add AppsCode chart repository to your helm repository list, ```console -helm install appscode/postgres-stash --name postgres-stash +helm repo add appscode https://charts.appscode.com/stable/ ``` -The command installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database using Stash. +- Update helm repositories to fetch latest charts from the remove repository, + +```console +helm repo update +``` + +- Install the chart with the release name `postgres-stash-9.6` run the following command, + +```console +helm install appscode/postgres-stash --name=postgres-stash-9.6 --version=9.6 +``` -> **Tip**: List all releases using `helm list` +The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 9.6 using Stash. ## Uninstalling the Chart -To uninstall/delete the `postgres-stash`: +To uninstall/delete the `postgres-stash-9.6` run the following command, ```console -helm delete postgres-stash +helm delete postgres-stash-9.6 ``` The command removes all the Kubernetes components associated with the chart and deletes the release. ## Configuration -The following table lists the configurable parameters of the Postgre-stash chart and their default values. +The following table lists the configurable parameters of the `postgre-stash` chart and their default values. | Parameter | Description | Default | | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | `global.registry` | Docker registry used to pull respective images | `appscode` | | `global.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.x` | +| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.6` | | `global.backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | | `global.restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | | `global.metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | -| `global.metrics.labels` | Optional comma separated labels to add the Prometheus metrics | | +| `global.metrics.labels` | Optional comma separated labels to add to the Prometheus metrics | | > We have declared all the configurable parameters as global parameter so that the parent chart can overwrite them. @@ -61,7 +71,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm For example: ```console -helm install --name postgres-stash --set global.metrics.enabled=false appscode/postgres-stash +helm install --name postgres-stash-9.6 --set global.metrics.enabled=false appscode/postgres-stash ``` **Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `global.metrics.labels`. diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 28f918e31..88186b8bb 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 -description: 'Postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash' +description: 'postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash.' name: postgres-stash -version: 9 -appVersion: 9 +version: 9.6 +appVersion: 9.6 home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index 2181df185..0c8f395b6 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -6,7 +6,7 @@ global: registry: appscode image: postgres-stash - tag: 9 + tag: 9.6 # optional argument to send pgdump or psql command backup: diff --git a/docs/examples/backup/appbinding.yaml b/docs/examples/backup/appbinding.yaml index c0d56fb2d..3ad30134c 100644 --- a/docs/examples/backup/appbinding.yaml +++ b/docs/examples/backup/appbinding.yaml @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "11.2" + app.kubernetes.io/version: "9.6" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... diff --git a/docs/examples/backup/backupconfiguration.yaml b/docs/examples/backup/backupconfiguration.yaml index 349dee2a7..c21b72ac9 100644 --- a/docs/examples/backup/backupconfiguration.yaml +++ b/docs/examples/backup/backupconfiguration.yaml @@ -6,7 +6,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup + name: pg-backup-9.6 repository: name: gcs-repo target: diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml index 558c1f5d3..4f26b39f3 100644 --- a/docs/examples/restore/restoresession.yaml +++ b/docs/examples/restore/restoresession.yaml @@ -7,7 +7,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore + name: pg-restore-9.6 repository: name: gcs-repo target: diff --git a/docs/postgres.md b/docs/postgres.md index 7c8c81024..6e099ac84 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -22,7 +22,7 @@ Stash supports backup and restores PostgreSQL database. This guide will show you - Install Stash in your cluster following the steps [here](https://appscode.com/products/stash/0.8.3/setup/install/). -- Install [KubeDB](https://kubedb.com)(`Optional`) in your cluster following the steps [here](https://kubedb.com/docs/0.12.0/setup/install/). +- Install [KubeDB](https://kubedb.com) in your cluster following the steps [here](https://kubedb.com/docs/0.12.0/setup/install/). - If you are not familiar with how Stash backup and restore databases, please check the following guide: - [How Stash backup and restore databases](https://appscode.com/products/stash/0.8.3/guides/databases/overview/). @@ -44,35 +44,54 @@ namespace/demo created >Note: YAML files used in this tutorial are stored [here](https://github.com/stashed/postgres/examples/). -## Install Postgres plugin for Stash +## Install Postgres Catalog for Stash -At first, we have to install Postgres plugin `postgres-stash` for Stash. This plugin creates necessary `Function` and `Task` definition which is used by Stash to backup or restore a PostgreSQL database. We are going to use [Helm](https://helm.sh/) to install `postgres-stash` chart. +At first, we have to install Postgres plugin (`postgres-catalog`) for Stash. This plugin creates necessary `Function` and `Task` definition which is used by Stash to backup or restore a PostgreSQL database. We are going to use [Helm](https://helm.sh/) to install `postgres-catalog` chart. -Let's install `postgres-stash` chart, +If you have already installed `stash-catalog` which contains necessary `Function` and `Task` definition to backup or restore all the databases supported by Stash, you can skip installing `postgres-catalog`. + +Let's install `postgres-catalog` chart, ```console -$ helm repo add appscode https://charts.appscode.com/stable/ -$ helm repo update -$ helm install appscode/postgres-stash --name postgres-stash +helm repo add appscode https://charts.appscode.com/stable/ +helm repo update +helm install appscode/postgres-catalog --name postgres-catalog ``` -Once installed, this will create `pg-backup` and `pg-recovery` Function. Verify that the Functions has been created successfully by, +Once installed, this will create `pg-backup-*` and `pg-recovery-*` Functions for all supported PostgreSQL versions. Verify that the Functions has been created successfully by, ```console $ kubectl get function -NAME AGE -pg-backup 3h7m -pg-restore 3h7m -update-status 3h7m -``` - -This will also create `pg-backup` and `pg-restore` Task. Verify that they have been created successfully by, +NAME AGE +pg-backup-9.6 6s +pg-backup-10.2 6s +pg-backup-10.6 6s +pg-backup-11.1 6s +pg-backup-11.2 6s +pg-restore-9.6 6s +pg-restore-10.2 6s +pg-restore-10.6 6s +pg-restore-11.1 6s +pg-restore-11.2 6s +update-status 6d19h +``` + +This will also create `pg-backup-*` and `pg-restore-*` Tasks for all supported PostgreSQL versions. Verify that they have been created successfully by, ```console $ kubectl get task -NAME AGE -pg-backup 3h9m -pg-restore 3h9m +NAME AGE +NAME AGE +pg-backup-9.6 10s +pg-backup-10.2 10s +pg-backup-10.6 10s +pg-backup-11.1 10s +pg-backup-11.2 10s +pg-restore-9.6 10s +pg-restore-10.2 10s +pg-restore-10.6 10s +pg-restore-11.1 10s +pg-restore-11.2 10s ``` Now, Stash is ready to backup PostgreSQL database. @@ -336,7 +355,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup + name: pg-backup-9.6 repository: name: gcs-repo target: @@ -490,7 +509,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore + name: pg-restore-9.6 repository: name: gcs-repo target: @@ -604,3 +623,9 @@ kubectl delete backupconfiguration -n demo sample-postgres-backup kubectl delete pg -n demo restored-postgres kubectl delete pg -n demo sample-postgres ``` + +To uninstall `postgres-catalog` chart, run the following command, + +```console +helm delete postgres-catalog +``` diff --git a/hack/setup.sh b/hack/setup.sh index 96b60c4ad..5cdaf49ff 100755 --- a/hack/setup.sh +++ b/hack/setup.sh @@ -13,7 +13,7 @@ CHART_LOCATION="chart" APPSCODE_ENV=${APPSCODE_ENV:-prod} DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} -IMAGE_TAG=9 +IMAGE_TAG=9.6 BACKUP_ARGS="" RESTORE_ARGS="" @@ -112,7 +112,7 @@ while test $# -gt 0; do ;; --metrics-enabled*) val=$(echo $1 | sed -e 's/^[^=]*=//g') - if [ "$val" = "false" ]; then + if [[ "$val" == "false" ]]; then ENABLE_PROMETHEUS_METRICS=false fi shift From 1f1bcae8b82874bf2f7c1fdf74c9c62545302ea5 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 19 Jun 2019 16:51:58 +0600 Subject: [PATCH 15/25] Update charts and docs for 10.2 --- Makefile | 4 ++-- README.md | 12 +++++------ chart/README.md | 18 ++++++++--------- chart/postgres-stash/Chart.yaml | 4 ++-- chart/postgres-stash/values.yaml | 2 +- docs/examples/backup/appbinding.yaml | 2 +- docs/examples/backup/backupconfiguration.yaml | 2 +- docs/examples/backup/postgres.yaml | 2 +- docs/examples/restore/restored-postgres.yaml | 2 +- docs/examples/restore/restoresession.yaml | 2 +- docs/postgres.md | 20 +++++++++---------- hack/setup.sh | 2 +- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 7acaa2e49..867f570ab 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= postgres:10.6-alpine -BASEIMAGE_DBG ?= postgres:10.6 +BASEIMAGE_PROD ?= postgres:10.2-alpine +BASEIMAGE_DBG ?= postgres:10.2 IMAGE := $(REGISTRY)/$(BIN) VERSION_PROD := $(VERSION) diff --git a/README.md b/README.md index 38b0ea4bf..ff1604417 100644 --- a/README.md +++ b/README.md @@ -10,36 +10,36 @@ Postgres backup and restore plugin for [Stash by AppsCode](https://appscode.com/ ## Install -Install PostgreSQL 9.6 backup or restore plugin for Stash as below. +Install PostgreSQL 10.2 backup or restore plugin for Stash as below. **Chart:** ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-9.6 --version=9.6 +helm install appscode/postgres-stash --name=postgres-stash-10.2 --version=10.2 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/9.6/hack/setup.sh | bash +curl -fsSL https://github.com/stashed/postgres/raw/10.2/hack/setup.sh | bash ``` ## Uninstall -Uninstall PostgreSQL 9.6 backup or restore plugin for Stash as below. +Uninstall PostgreSQL 10.2 backup or restore plugin for Stash as below. **Chart:** ```console -helm delete postgres-stash-9.6 +helm delete postgres-stash-10.2 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/9.6/hack/setup.sh | bash -s -- --uninstall +curl -fsSL https://github.com/stashed/postgres/raw/10.2/hack/setup.sh | bash -s -- --uninstall ``` ## Support diff --git a/chart/README.md b/chart/README.md index 146ae4260..8b31298a9 100644 --- a/chart/README.md +++ b/chart/README.md @@ -7,12 +7,12 @@ ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-9.6 --version=9.6 +helm install appscode/postgres-stash --name=postgres-stash-10.2 --version=10.2 ``` ## Introduction -This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 9.6 using Stash. +This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 10.2 using Stash. ## Prerequisites @@ -32,20 +32,20 @@ helm repo add appscode https://charts.appscode.com/stable/ helm repo update ``` -- Install the chart with the release name `postgres-stash-9.6` run the following command, +- Install the chart with the release name `postgres-stash-10.2` run the following command, ```console -helm install appscode/postgres-stash --name=postgres-stash-9.6 --version=9.6 +helm install appscode/postgres-stash --name=postgres-stash-10.2 --version=10.2 ``` -The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 9.6 using Stash. +The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 10.2 using Stash. ## Uninstalling the Chart -To uninstall/delete the `postgres-stash-9.6` run the following command, +To uninstall/delete the `postgres-stash-10.2` run the following command, ```console -helm delete postgres-stash-9.6 +helm delete postgres-stash-10.2 ``` The command removes all the Kubernetes components associated with the chart and deletes the release. @@ -58,7 +58,7 @@ The following table lists the configurable parameters of the `postgre-stash` cha | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | `global.registry` | Docker registry used to pull respective images | `appscode` | | `global.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.6` | +| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `10.2` | | `global.backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | | `global.restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | | `global.metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | @@ -71,7 +71,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm For example: ```console -helm install --name postgres-stash-9.6 --set global.metrics.enabled=false appscode/postgres-stash +helm install --name postgres-stash-10.2 --set global.metrics.enabled=false appscode/postgres-stash ``` **Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `global.metrics.labels`. diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 88186b8bb..7f4f27e8c 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash.' name: postgres-stash -version: 9.6 -appVersion: 9.6 +version: 10.2 +appVersion: 10.2 home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index 0c8f395b6..81e68bc93 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -6,7 +6,7 @@ global: registry: appscode image: postgres-stash - tag: 9.6 + tag: 10.2 # optional argument to send pgdump or psql command backup: diff --git a/docs/examples/backup/appbinding.yaml b/docs/examples/backup/appbinding.yaml index 3ad30134c..798c57920 100644 --- a/docs/examples/backup/appbinding.yaml +++ b/docs/examples/backup/appbinding.yaml @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "9.6" + app.kubernetes.io/version: "10.2-v4" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... diff --git a/docs/examples/backup/backupconfiguration.yaml b/docs/examples/backup/backupconfiguration.yaml index c21b72ac9..024ea33d8 100644 --- a/docs/examples/backup/backupconfiguration.yaml +++ b/docs/examples/backup/backupconfiguration.yaml @@ -6,7 +6,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-9.6 + name: pg-backup-10.2 repository: name: gcs-repo target: diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml index 28d22bd12..3bb96804e 100644 --- a/docs/examples/backup/postgres.yaml +++ b/docs/examples/backup/postgres.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "9.6.7-v4" + version: "10.2-v4" storageType: Durable storage: storageClassName: "standard" diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml index 4c94935d7..c3c3eb83b 100644 --- a/docs/examples/restore/restored-postgres.yaml +++ b/docs/examples/restore/restored-postgres.yaml @@ -4,7 +4,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "9.6.7-v4" + version: "10.2-v4" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml index 4f26b39f3..dbb582357 100644 --- a/docs/examples/restore/restoresession.yaml +++ b/docs/examples/restore/restoresession.yaml @@ -7,7 +7,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-9.6 + name: pg-restore-10.2 repository: name: gcs-repo target: diff --git a/docs/postgres.md b/docs/postgres.md index 6e099ac84..41bb7711f 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -115,7 +115,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "9.6.7-v4" + version: "10.2-v4" storageType: Durable storage: storageClassName: "standard" @@ -141,7 +141,7 @@ Let's check if the database is ready to use, ```console $ kubectl get pg -n demo sample-postgres NAME VERSION STATUS AGE -sample-postgres 9.6.7-v4 Running 3m11s +sample-postgres 10.2-v4 Running 3m11s ``` The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using the following commands, @@ -187,7 +187,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "9.6.7-v4" + app.kubernetes.io/version: "10.2-v4" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... @@ -252,7 +252,7 @@ Now, let's exec into the pod and create a table, $ kubectl exec -it -n demo sample-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (9.6.7) +psql (10.2) Type "help" for help. # list available databases @@ -355,7 +355,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-9.6 + name: pg-backup-10.2 repository: name: gcs-repo target: @@ -447,7 +447,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "9.6.7-v4" + version: "10.2-v4" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database @@ -480,7 +480,7 @@ If you check the database status, you will see it is stuck in `Initializing` sta ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 9.6.7-v4 Initializing 3m21s +restored-postgres 10.2-v4 Initializing 3m21s ``` **Create RestoreSession:** @@ -509,7 +509,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-9.6 + name: pg-restore-10.2 repository: name: gcs-repo target: @@ -560,7 +560,7 @@ At first, check if the database has gone into `Running` state by the following c ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 9.6.7-v4 Running 2m16s +restored-postgres 10.2-v4 Running 2m16s ``` Now, find out the database pod by the following command, @@ -577,7 +577,7 @@ Now, exec into the database pod and list available tables, $ kubectl exec -it -n demo restored-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (9.6.7) +psql (10.2) Type "help" for help. # list available databases diff --git a/hack/setup.sh b/hack/setup.sh index 5cdaf49ff..b4a1fb7e1 100755 --- a/hack/setup.sh +++ b/hack/setup.sh @@ -13,7 +13,7 @@ CHART_LOCATION="chart" APPSCODE_ENV=${APPSCODE_ENV:-prod} DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} -IMAGE_TAG=9.6 +IMAGE_TAG=10.2 BACKUP_ARGS="" RESTORE_ARGS="" From 80b0cb9ca9e7af975a8841c135c26c306592b86f Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 19 Jun 2019 17:02:43 +0600 Subject: [PATCH 16/25] Update chart and docs for PostgreSQL 10.6 --- Makefile | 4 ++-- README.md | 12 +++++------ chart/README.md | 18 ++++++++--------- chart/postgres-stash/Chart.yaml | 4 ++-- chart/postgres-stash/values.yaml | 2 +- docs/examples/backup/appbinding.yaml | 2 +- docs/examples/backup/backupconfiguration.yaml | 2 +- docs/examples/backup/postgres.yaml | 2 +- docs/examples/restore/restored-postgres.yaml | 2 +- docs/examples/restore/restoresession.yaml | 2 +- docs/postgres.md | 20 +++++++++---------- hack/setup.sh | 2 +- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 867f570ab..7acaa2e49 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= postgres:10.2-alpine -BASEIMAGE_DBG ?= postgres:10.2 +BASEIMAGE_PROD ?= postgres:10.6-alpine +BASEIMAGE_DBG ?= postgres:10.6 IMAGE := $(REGISTRY)/$(BIN) VERSION_PROD := $(VERSION) diff --git a/README.md b/README.md index ff1604417..089f168b7 100644 --- a/README.md +++ b/README.md @@ -10,36 +10,36 @@ Postgres backup and restore plugin for [Stash by AppsCode](https://appscode.com/ ## Install -Install PostgreSQL 10.2 backup or restore plugin for Stash as below. +Install PostgreSQL 10.6 backup or restore plugin for Stash as below. **Chart:** ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-10.2 --version=10.2 +helm install appscode/postgres-stash --name=postgres-stash-10.6 --version=10.6 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/10.2/hack/setup.sh | bash +curl -fsSL https://github.com/stashed/postgres/raw/10.6/hack/setup.sh | bash ``` ## Uninstall -Uninstall PostgreSQL 10.2 backup or restore plugin for Stash as below. +Uninstall PostgreSQL 10.6 backup or restore plugin for Stash as below. **Chart:** ```console -helm delete postgres-stash-10.2 +helm delete postgres-stash-10.6 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/10.2/hack/setup.sh | bash -s -- --uninstall +curl -fsSL https://github.com/stashed/postgres/raw/10.6/hack/setup.sh | bash -s -- --uninstall ``` ## Support diff --git a/chart/README.md b/chart/README.md index 8b31298a9..9937ca06c 100644 --- a/chart/README.md +++ b/chart/README.md @@ -7,12 +7,12 @@ ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-10.2 --version=10.2 +helm install appscode/postgres-stash --name=postgres-stash-10.6 --version=10.6 ``` ## Introduction -This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 10.2 using Stash. +This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 10.6 using Stash. ## Prerequisites @@ -32,20 +32,20 @@ helm repo add appscode https://charts.appscode.com/stable/ helm repo update ``` -- Install the chart with the release name `postgres-stash-10.2` run the following command, +- Install the chart with the release name `postgres-stash-10.6` run the following command, ```console -helm install appscode/postgres-stash --name=postgres-stash-10.2 --version=10.2 +helm install appscode/postgres-stash --name=postgres-stash-10.6 --version=10.6 ``` -The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 10.2 using Stash. +The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 10.6 using Stash. ## Uninstalling the Chart -To uninstall/delete the `postgres-stash-10.2` run the following command, +To uninstall/delete the `postgres-stash-10.6` run the following command, ```console -helm delete postgres-stash-10.2 +helm delete postgres-stash-10.6 ``` The command removes all the Kubernetes components associated with the chart and deletes the release. @@ -58,7 +58,7 @@ The following table lists the configurable parameters of the `postgre-stash` cha | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | `global.registry` | Docker registry used to pull respective images | `appscode` | | `global.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `10.2` | +| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `10.6` | | `global.backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | | `global.restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | | `global.metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | @@ -71,7 +71,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm For example: ```console -helm install --name postgres-stash-10.2 --set global.metrics.enabled=false appscode/postgres-stash +helm install --name postgres-stash-10.6 --set global.metrics.enabled=false appscode/postgres-stash ``` **Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `global.metrics.labels`. diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 7f4f27e8c..e7de79784 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash.' name: postgres-stash -version: 10.2 -appVersion: 10.2 +version: 10.6 +appVersion: 10.6 home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index 81e68bc93..f56c91f04 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -6,7 +6,7 @@ global: registry: appscode image: postgres-stash - tag: 10.2 + tag: 10.6 # optional argument to send pgdump or psql command backup: diff --git a/docs/examples/backup/appbinding.yaml b/docs/examples/backup/appbinding.yaml index 798c57920..0d8ac0eda 100644 --- a/docs/examples/backup/appbinding.yaml +++ b/docs/examples/backup/appbinding.yaml @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "10.2-v4" + app.kubernetes.io/version: "10.6-v2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... diff --git a/docs/examples/backup/backupconfiguration.yaml b/docs/examples/backup/backupconfiguration.yaml index 024ea33d8..eb69289fe 100644 --- a/docs/examples/backup/backupconfiguration.yaml +++ b/docs/examples/backup/backupconfiguration.yaml @@ -6,7 +6,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-10.2 + name: pg-backup-10.6 repository: name: gcs-repo target: diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml index 3bb96804e..e6337a44c 100644 --- a/docs/examples/backup/postgres.yaml +++ b/docs/examples/backup/postgres.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "10.2-v4" + version: "10.6-v2" storageType: Durable storage: storageClassName: "standard" diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml index c3c3eb83b..ceecfd76c 100644 --- a/docs/examples/restore/restored-postgres.yaml +++ b/docs/examples/restore/restored-postgres.yaml @@ -4,7 +4,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "10.2-v4" + version: "10.6-v2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml index dbb582357..0b4b12722 100644 --- a/docs/examples/restore/restoresession.yaml +++ b/docs/examples/restore/restoresession.yaml @@ -7,7 +7,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-10.2 + name: pg-restore-10.6 repository: name: gcs-repo target: diff --git a/docs/postgres.md b/docs/postgres.md index 41bb7711f..dc1a754e9 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -115,7 +115,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "10.2-v4" + version: "10.6-v2" storageType: Durable storage: storageClassName: "standard" @@ -141,7 +141,7 @@ Let's check if the database is ready to use, ```console $ kubectl get pg -n demo sample-postgres NAME VERSION STATUS AGE -sample-postgres 10.2-v4 Running 3m11s +sample-postgres 10.6-v2 Running 3m11s ``` The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using the following commands, @@ -187,7 +187,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "10.2-v4" + app.kubernetes.io/version: "10.6-v2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... @@ -252,7 +252,7 @@ Now, let's exec into the pod and create a table, $ kubectl exec -it -n demo sample-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (10.2) +psql (10.6) Type "help" for help. # list available databases @@ -355,7 +355,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-10.2 + name: pg-backup-10.6 repository: name: gcs-repo target: @@ -447,7 +447,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "10.2-v4" + version: "10.6-v2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database @@ -480,7 +480,7 @@ If you check the database status, you will see it is stuck in `Initializing` sta ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 10.2-v4 Initializing 3m21s +restored-postgres 10.6-v2 Initializing 3m21s ``` **Create RestoreSession:** @@ -509,7 +509,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-10.2 + name: pg-restore-10.6 repository: name: gcs-repo target: @@ -560,7 +560,7 @@ At first, check if the database has gone into `Running` state by the following c ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 10.2-v4 Running 2m16s +restored-postgres 10.6-v2 Running 2m16s ``` Now, find out the database pod by the following command, @@ -577,7 +577,7 @@ Now, exec into the database pod and list available tables, $ kubectl exec -it -n demo restored-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (10.2) +psql (10.6) Type "help" for help. # list available databases diff --git a/hack/setup.sh b/hack/setup.sh index b4a1fb7e1..0ad629f30 100755 --- a/hack/setup.sh +++ b/hack/setup.sh @@ -13,7 +13,7 @@ CHART_LOCATION="chart" APPSCODE_ENV=${APPSCODE_ENV:-prod} DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} -IMAGE_TAG=10.2 +IMAGE_TAG=10.6 BACKUP_ARGS="" RESTORE_ARGS="" From e3da9b74e71947e1684d8bd85723bb24bdcd302b Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 19 Jun 2019 17:10:40 +0600 Subject: [PATCH 17/25] Update chart/docs for PostgreSQL 11.1 --- Makefile | 4 ++-- README.md | 12 +++++------ chart/README.md | 18 ++++++++--------- chart/postgres-stash/Chart.yaml | 4 ++-- chart/postgres-stash/values.yaml | 2 +- docs/examples/backup/appbinding.yaml | 2 +- docs/examples/backup/backupconfiguration.yaml | 2 +- docs/examples/backup/postgres.yaml | 2 +- docs/examples/restore/restored-postgres.yaml | 2 +- docs/examples/restore/restoresession.yaml | 2 +- docs/postgres.md | 20 +++++++++---------- hack/setup.sh | 2 +- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 7acaa2e49..ab1099bbb 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= postgres:10.6-alpine -BASEIMAGE_DBG ?= postgres:10.6 +BASEIMAGE_PROD ?= postgres:11.1-alpine +BASEIMAGE_DBG ?= postgres:11.1 IMAGE := $(REGISTRY)/$(BIN) VERSION_PROD := $(VERSION) diff --git a/README.md b/README.md index 089f168b7..f4259308f 100644 --- a/README.md +++ b/README.md @@ -10,36 +10,36 @@ Postgres backup and restore plugin for [Stash by AppsCode](https://appscode.com/ ## Install -Install PostgreSQL 10.6 backup or restore plugin for Stash as below. +Install PostgreSQL 11.1 backup or restore plugin for Stash as below. **Chart:** ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-10.6 --version=10.6 +helm install appscode/postgres-stash --name=postgres-stash-11.1 --version=11.1 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/10.6/hack/setup.sh | bash +curl -fsSL https://github.com/stashed/postgres/raw/11.1/hack/setup.sh | bash ``` ## Uninstall -Uninstall PostgreSQL 10.6 backup or restore plugin for Stash as below. +Uninstall PostgreSQL 11.1 backup or restore plugin for Stash as below. **Chart:** ```console -helm delete postgres-stash-10.6 +helm delete postgres-stash-11.1 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/10.6/hack/setup.sh | bash -s -- --uninstall +curl -fsSL https://github.com/stashed/postgres/raw/11.1/hack/setup.sh | bash -s -- --uninstall ``` ## Support diff --git a/chart/README.md b/chart/README.md index 9937ca06c..cf273a705 100644 --- a/chart/README.md +++ b/chart/README.md @@ -7,12 +7,12 @@ ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-10.6 --version=10.6 +helm install appscode/postgres-stash --name=postgres-stash-11.1 --version=11.1 ``` ## Introduction -This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 10.6 using Stash. +This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 11.1 using Stash. ## Prerequisites @@ -32,20 +32,20 @@ helm repo add appscode https://charts.appscode.com/stable/ helm repo update ``` -- Install the chart with the release name `postgres-stash-10.6` run the following command, +- Install the chart with the release name `postgres-stash-11.1` run the following command, ```console -helm install appscode/postgres-stash --name=postgres-stash-10.6 --version=10.6 +helm install appscode/postgres-stash --name=postgres-stash-11.1 --version=11.1 ``` -The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 10.6 using Stash. +The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 11.1 using Stash. ## Uninstalling the Chart -To uninstall/delete the `postgres-stash-10.6` run the following command, +To uninstall/delete the `postgres-stash-11.1` run the following command, ```console -helm delete postgres-stash-10.6 +helm delete postgres-stash-11.1 ``` The command removes all the Kubernetes components associated with the chart and deletes the release. @@ -58,7 +58,7 @@ The following table lists the configurable parameters of the `postgre-stash` cha | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | `global.registry` | Docker registry used to pull respective images | `appscode` | | `global.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `10.6` | +| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `11.1` | | `global.backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | | `global.restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | | `global.metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | @@ -71,7 +71,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm For example: ```console -helm install --name postgres-stash-10.6 --set global.metrics.enabled=false appscode/postgres-stash +helm install --name postgres-stash-11.1 --set global.metrics.enabled=false appscode/postgres-stash ``` **Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `global.metrics.labels`. diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index e7de79784..5689e7204 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash.' name: postgres-stash -version: 10.6 -appVersion: 10.6 +version: 11.1 +appVersion: 11.1 home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index f56c91f04..8e23f5836 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -6,7 +6,7 @@ global: registry: appscode image: postgres-stash - tag: 10.6 + tag: 11.1 # optional argument to send pgdump or psql command backup: diff --git a/docs/examples/backup/appbinding.yaml b/docs/examples/backup/appbinding.yaml index 0d8ac0eda..047926186 100644 --- a/docs/examples/backup/appbinding.yaml +++ b/docs/examples/backup/appbinding.yaml @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "10.6-v2" + app.kubernetes.io/version: "11.1-v2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... diff --git a/docs/examples/backup/backupconfiguration.yaml b/docs/examples/backup/backupconfiguration.yaml index eb69289fe..5e89677fb 100644 --- a/docs/examples/backup/backupconfiguration.yaml +++ b/docs/examples/backup/backupconfiguration.yaml @@ -6,7 +6,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-10.6 + name: pg-backup-11.1 repository: name: gcs-repo target: diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml index e6337a44c..394b7c813 100644 --- a/docs/examples/backup/postgres.yaml +++ b/docs/examples/backup/postgres.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "10.6-v2" + version: "11.1-v2" storageType: Durable storage: storageClassName: "standard" diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml index ceecfd76c..b21d8c730 100644 --- a/docs/examples/restore/restored-postgres.yaml +++ b/docs/examples/restore/restored-postgres.yaml @@ -4,7 +4,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "10.6-v2" + version: "11.1-v2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml index 0b4b12722..e6238d0e3 100644 --- a/docs/examples/restore/restoresession.yaml +++ b/docs/examples/restore/restoresession.yaml @@ -7,7 +7,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-10.6 + name: pg-restore-11.1 repository: name: gcs-repo target: diff --git a/docs/postgres.md b/docs/postgres.md index dc1a754e9..63c7b6446 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -115,7 +115,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "10.6-v2" + version: "11.1-v2" storageType: Durable storage: storageClassName: "standard" @@ -141,7 +141,7 @@ Let's check if the database is ready to use, ```console $ kubectl get pg -n demo sample-postgres NAME VERSION STATUS AGE -sample-postgres 10.6-v2 Running 3m11s +sample-postgres 11.1-v2 Running 3m11s ``` The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using the following commands, @@ -187,7 +187,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "10.6-v2" + app.kubernetes.io/version: "11.1-v2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... @@ -252,7 +252,7 @@ Now, let's exec into the pod and create a table, $ kubectl exec -it -n demo sample-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (10.6) +psql (11.1) Type "help" for help. # list available databases @@ -355,7 +355,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-10.6 + name: pg-backup-11.1 repository: name: gcs-repo target: @@ -447,7 +447,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "10.6-v2" + version: "11.1-v2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database @@ -480,7 +480,7 @@ If you check the database status, you will see it is stuck in `Initializing` sta ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 10.6-v2 Initializing 3m21s +restored-postgres 11.1-v2 Initializing 3m21s ``` **Create RestoreSession:** @@ -509,7 +509,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-10.6 + name: pg-restore-11.1 repository: name: gcs-repo target: @@ -560,7 +560,7 @@ At first, check if the database has gone into `Running` state by the following c ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 10.6-v2 Running 2m16s +restored-postgres 11.1-v2 Running 2m16s ``` Now, find out the database pod by the following command, @@ -577,7 +577,7 @@ Now, exec into the database pod and list available tables, $ kubectl exec -it -n demo restored-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (10.6) +psql (11.1) Type "help" for help. # list available databases diff --git a/hack/setup.sh b/hack/setup.sh index 0ad629f30..47a0471ee 100755 --- a/hack/setup.sh +++ b/hack/setup.sh @@ -13,7 +13,7 @@ CHART_LOCATION="chart" APPSCODE_ENV=${APPSCODE_ENV:-prod} DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} -IMAGE_TAG=10.6 +IMAGE_TAG=11.1 BACKUP_ARGS="" RESTORE_ARGS="" From 3e2f6b4613fd00b4810a46e7a827cb6c53d64d82 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Wed, 19 Jun 2019 17:26:48 +0600 Subject: [PATCH 18/25] Update chart/docs for PostgreSQL 11.2 --- Makefile | 4 ++-- README.md | 12 +++++------ chart/README.md | 18 ++++++++--------- chart/postgres-stash/Chart.yaml | 4 ++-- chart/postgres-stash/values.yaml | 2 +- docs/examples/backup/appbinding.yaml | 2 +- docs/examples/backup/backupconfiguration.yaml | 2 +- docs/examples/backup/postgres.yaml | 2 +- docs/examples/restore/restored-postgres.yaml | 2 +- docs/examples/restore/restoresession.yaml | 2 +- docs/postgres.md | 20 +++++++++---------- hack/setup.sh | 2 +- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index ab1099bbb..0542dd085 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ BIN_PLATFORMS := $(DOCKER_PLATFORMS) OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE_PROD ?= postgres:11.1-alpine -BASEIMAGE_DBG ?= postgres:11.1 +BASEIMAGE_PROD ?= postgres:11.2-alpine +BASEIMAGE_DBG ?= postgres:11.2 IMAGE := $(REGISTRY)/$(BIN) VERSION_PROD := $(VERSION) diff --git a/README.md b/README.md index f4259308f..fdfdb071a 100644 --- a/README.md +++ b/README.md @@ -10,36 +10,36 @@ Postgres backup and restore plugin for [Stash by AppsCode](https://appscode.com/ ## Install -Install PostgreSQL 11.1 backup or restore plugin for Stash as below. +Install PostgreSQL 11.2 backup or restore plugin for Stash as below. **Chart:** ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-11.1 --version=11.1 +helm install appscode/postgres-stash --name=postgres-stash-11.2 --version=11.2 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/11.1/hack/setup.sh | bash +curl -fsSL https://github.com/stashed/postgres/raw/11.2/hack/setup.sh | bash ``` ## Uninstall -Uninstall PostgreSQL 11.1 backup or restore plugin for Stash as below. +Uninstall PostgreSQL 11.2 backup or restore plugin for Stash as below. **Chart:** ```console -helm delete postgres-stash-11.1 +helm delete postgres-stash-11.2 ``` **Script:** ```console -curl -fsSL https://github.com/stashed/postgres/raw/11.1/hack/setup.sh | bash -s -- --uninstall +curl -fsSL https://github.com/stashed/postgres/raw/11.2/hack/setup.sh | bash -s -- --uninstall ``` ## Support diff --git a/chart/README.md b/chart/README.md index cf273a705..8694ee7e4 100644 --- a/chart/README.md +++ b/chart/README.md @@ -7,12 +7,12 @@ ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update -helm install appscode/postgres-stash --name=postgres-stash-11.1 --version=11.1 +helm install appscode/postgres-stash --name=postgres-stash-11.2 --version=11.2 ``` ## Introduction -This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 11.1 using Stash. +This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 11.2 using Stash. ## Prerequisites @@ -32,20 +32,20 @@ helm repo add appscode https://charts.appscode.com/stable/ helm repo update ``` -- Install the chart with the release name `postgres-stash-11.1` run the following command, +- Install the chart with the release name `postgres-stash-11.2` run the following command, ```console -helm install appscode/postgres-stash --name=postgres-stash-11.1 --version=11.1 +helm install appscode/postgres-stash --name=postgres-stash-11.2 --version=11.2 ``` -The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 11.1 using Stash. +The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 11.2 using Stash. ## Uninstalling the Chart -To uninstall/delete the `postgres-stash-11.1` run the following command, +To uninstall/delete the `postgres-stash-11.2` run the following command, ```console -helm delete postgres-stash-11.1 +helm delete postgres-stash-11.2 ``` The command removes all the Kubernetes components associated with the chart and deletes the release. @@ -58,7 +58,7 @@ The following table lists the configurable parameters of the `postgre-stash` cha | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | `global.registry` | Docker registry used to pull respective images | `appscode` | | `global.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `11.1` | +| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `11.2` | | `global.backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | | `global.restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | | `global.metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | @@ -71,7 +71,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm For example: ```console -helm install --name postgres-stash-11.1 --set global.metrics.enabled=false appscode/postgres-stash +helm install --name postgres-stash-11.2 --set global.metrics.enabled=false appscode/postgres-stash ``` **Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `global.metrics.labels`. diff --git a/chart/postgres-stash/Chart.yaml b/chart/postgres-stash/Chart.yaml index 5689e7204..1a5a3820f 100644 --- a/chart/postgres-stash/Chart.yaml +++ b/chart/postgres-stash/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: 'postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash.' name: postgres-stash -version: 11.1 -appVersion: 11.1 +version: 11.2 +appVersion: 11.2 home: https://github.com/stashed/postgres icon: https://cdn.appscode.com/images/icon/stash.png sources: diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index 8e23f5836..1aaa211aa 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -6,7 +6,7 @@ global: registry: appscode image: postgres-stash - tag: 11.1 + tag: 11.2 # optional argument to send pgdump or psql command backup: diff --git a/docs/examples/backup/appbinding.yaml b/docs/examples/backup/appbinding.yaml index 047926186..c0d56fb2d 100644 --- a/docs/examples/backup/appbinding.yaml +++ b/docs/examples/backup/appbinding.yaml @@ -9,7 +9,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "11.1-v2" + app.kubernetes.io/version: "11.2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... diff --git a/docs/examples/backup/backupconfiguration.yaml b/docs/examples/backup/backupconfiguration.yaml index 5e89677fb..0cec6a4b0 100644 --- a/docs/examples/backup/backupconfiguration.yaml +++ b/docs/examples/backup/backupconfiguration.yaml @@ -6,7 +6,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-11.1 + name: pg-backup-11.2 repository: name: gcs-repo target: diff --git a/docs/examples/backup/postgres.yaml b/docs/examples/backup/postgres.yaml index 394b7c813..a84a3e713 100644 --- a/docs/examples/backup/postgres.yaml +++ b/docs/examples/backup/postgres.yaml @@ -4,7 +4,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "11.1-v2" + version: "11.2" storageType: Durable storage: storageClassName: "standard" diff --git a/docs/examples/restore/restored-postgres.yaml b/docs/examples/restore/restored-postgres.yaml index b21d8c730..d4f35ad9a 100644 --- a/docs/examples/restore/restored-postgres.yaml +++ b/docs/examples/restore/restored-postgres.yaml @@ -4,7 +4,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "11.1-v2" + version: "11.2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database diff --git a/docs/examples/restore/restoresession.yaml b/docs/examples/restore/restoresession.yaml index e6238d0e3..2f73e6ff0 100644 --- a/docs/examples/restore/restoresession.yaml +++ b/docs/examples/restore/restoresession.yaml @@ -7,7 +7,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-11.1 + name: pg-restore-11.2 repository: name: gcs-repo target: diff --git a/docs/postgres.md b/docs/postgres.md index 63c7b6446..877428015 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -115,7 +115,7 @@ metadata: name: sample-postgres namespace: demo spec: - version: "11.1-v2" + version: "11.2" storageType: Durable storage: storageClassName: "standard" @@ -141,7 +141,7 @@ Let's check if the database is ready to use, ```console $ kubectl get pg -n demo sample-postgres NAME VERSION STATUS AGE -sample-postgres 11.1-v2 Running 3m11s +sample-postgres 11.2 Running 3m11s ``` The database is `Running`. Verify that KubeDB has created a Secret and a Service for this database using the following commands, @@ -187,7 +187,7 @@ metadata: app.kubernetes.io/instance: sample-postgres app.kubernetes.io/managed-by: kubedb.com app.kubernetes.io/name: postgres - app.kubernetes.io/version: "11.1-v2" + app.kubernetes.io/version: "11.2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres ... @@ -252,7 +252,7 @@ Now, let's exec into the pod and create a table, $ kubectl exec -it -n demo sample-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (11.1) +psql (11.2) Type "help" for help. # list available databases @@ -355,7 +355,7 @@ metadata: spec: schedule: "*/5 * * * *" task: - name: pg-backup-11.1 + name: pg-backup-11.2 repository: name: gcs-repo target: @@ -447,7 +447,7 @@ metadata: name: restored-postgres namespace: demo spec: - version: "11.1-v2" + version: "11.2" storageType: Durable databaseSecret: secretName: sample-postgres-auth # use same secret as original the database @@ -480,7 +480,7 @@ If you check the database status, you will see it is stuck in `Initializing` sta ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 11.1-v2 Initializing 3m21s +restored-postgres 11.2 Initializing 3m21s ``` **Create RestoreSession:** @@ -509,7 +509,7 @@ metadata: kubedb.com/kind: Postgres # this label is mandatory if you are using KubeDB to deploy the database. spec: task: - name: pg-restore-11.1 + name: pg-restore-11.2 repository: name: gcs-repo target: @@ -560,7 +560,7 @@ At first, check if the database has gone into `Running` state by the following c ```console $ kubectl get pg -n demo restored-postgres NAME VERSION STATUS AGE -restored-postgres 11.1-v2 Running 2m16s +restored-postgres 11.2 Running 2m16s ``` Now, find out the database pod by the following command, @@ -577,7 +577,7 @@ Now, exec into the database pod and list available tables, $ kubectl exec -it -n demo restored-postgres-0 sh # login as "postgres" superuser. / # psql -U postgres -psql (11.1) +psql (11.2) Type "help" for help. # list available databases diff --git a/hack/setup.sh b/hack/setup.sh index 47a0471ee..32865daca 100755 --- a/hack/setup.sh +++ b/hack/setup.sh @@ -13,7 +13,7 @@ CHART_LOCATION="chart" APPSCODE_ENV=${APPSCODE_ENV:-prod} DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} -IMAGE_TAG=11.1 +IMAGE_TAG=11.2 BACKUP_ARGS="" RESTORE_ARGS="" From 7a90219c35a9bbaca160a8b07933f3d2730bc2c8 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Fri, 21 Jun 2019 16:10:17 +0600 Subject: [PATCH 19/25] replace . with - in version suffix of name --- chart/postgres-stash/templates/_helpers.tpl | 4 ++++ chart/postgres-stash/templates/pg-backup-function.yaml | 2 +- chart/postgres-stash/templates/pg-backup-task.yaml | 2 +- chart/postgres-stash/templates/pg-restore-function.yaml | 2 +- chart/postgres-stash/templates/pg-restore-task.yaml | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/chart/postgres-stash/templates/_helpers.tpl b/chart/postgres-stash/templates/_helpers.tpl index d407bbf87..453c34497 100644 --- a/chart/postgres-stash/templates/_helpers.tpl +++ b/chart/postgres-stash/templates/_helpers.tpl @@ -31,6 +31,10 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- define "postgres-stash.versionSuffix" -}} +{{- .Chart.Version | replace "." "-" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + # default labels for posgres-stash resources {{- define "postgres-stash.labels" -}} app.kubernetes.io/name: {{ include "postgres-stash.name" . }} diff --git a/chart/postgres-stash/templates/pg-backup-function.yaml b/chart/postgres-stash/templates/pg-backup-function.yaml index f0f05bd9a..6ccc2f6d4 100644 --- a/chart/postgres-stash/templates/pg-backup-function.yaml +++ b/chart/postgres-stash/templates/pg-backup-function.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Function metadata: - name: pg-backup-{{ .Chart.Version }} + name: pg-backup-{{- include "postgres-stash.versionSuffix" . }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: diff --git a/chart/postgres-stash/templates/pg-backup-task.yaml b/chart/postgres-stash/templates/pg-backup-task.yaml index 395a3177c..de1a9e8a3 100644 --- a/chart/postgres-stash/templates/pg-backup-task.yaml +++ b/chart/postgres-stash/templates/pg-backup-task.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Task metadata: - name: pg-backup-{{ .Chart.Version }} + name: pg-backup-{{- include "postgres-stash.versionSuffix" . }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: diff --git a/chart/postgres-stash/templates/pg-restore-function.yaml b/chart/postgres-stash/templates/pg-restore-function.yaml index 21f494834..4ea9ed077 100644 --- a/chart/postgres-stash/templates/pg-restore-function.yaml +++ b/chart/postgres-stash/templates/pg-restore-function.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Function metadata: - name: pg-restore-{{ .Chart.Version }} + name: pg-restore-{{- include "postgres-stash.versionSuffix" . }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: diff --git a/chart/postgres-stash/templates/pg-restore-task.yaml b/chart/postgres-stash/templates/pg-restore-task.yaml index c3ec7d2fa..0aed1decc 100644 --- a/chart/postgres-stash/templates/pg-restore-task.yaml +++ b/chart/postgres-stash/templates/pg-restore-task.yaml @@ -1,7 +1,7 @@ apiVersion: stash.appscode.com/v1beta1 kind: Task metadata: - name: pg-restore-{{ .Chart.Version }} + name: pg-restore-{{- include "postgres-stash.versionSuffix" . }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: From 41a831a672c12448fef3a052a8b86e5f7e115b39 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Fri, 21 Jun 2019 16:40:45 +0600 Subject: [PATCH 20/25] Fix function name in task --- chart/postgres-stash/templates/pg-backup-task.yaml | 2 +- chart/postgres-stash/templates/pg-restore-task.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/postgres-stash/templates/pg-backup-task.yaml b/chart/postgres-stash/templates/pg-backup-task.yaml index de1a9e8a3..242cb3bb2 100644 --- a/chart/postgres-stash/templates/pg-backup-task.yaml +++ b/chart/postgres-stash/templates/pg-backup-task.yaml @@ -6,7 +6,7 @@ metadata: {{- include "postgres-stash.labels" . | nindent 4 }} spec: steps: - - name: pg-backup + - name: pg-backup-{{- include "postgres-stash.versionSuffix" . }} params: - name: outputDir value: /tmp/output diff --git a/chart/postgres-stash/templates/pg-restore-task.yaml b/chart/postgres-stash/templates/pg-restore-task.yaml index 0aed1decc..aac06a93d 100644 --- a/chart/postgres-stash/templates/pg-restore-task.yaml +++ b/chart/postgres-stash/templates/pg-restore-task.yaml @@ -6,7 +6,7 @@ metadata: {{- include "postgres-stash.labels" . | nindent 4 }} spec: steps: - - name: pg-restore + - name: pg-restore-{{- include "postgres-stash.versionSuffix" . }} params: - name: outputDir value: /tmp/output From b5094b4d4c8f5eec2c8ac0c3bc0876d1ecf1c9e5 Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Mon, 8 Jul 2019 17:22:58 +0600 Subject: [PATCH 21/25] Fix chart + remove setup script --- README.md | 16 +- chart/README.md | 26 ++- chart/postgres-stash/templates/_helpers.tpl | 4 - .../templates/pg-backup-function.yaml | 12 +- .../templates/pg-backup-task.yaml | 4 +- .../templates/pg-restore-function.yaml | 12 +- .../templates/pg-restore-task.yaml | 4 +- chart/postgres-stash/values.yaml | 20 +- docs/examples/backup/minimal_appbinding.yaml | 1 + docs/postgres.md | 1 + hack/setup.sh | 195 ------------------ 11 files changed, 41 insertions(+), 254 deletions(-) delete mode 100755 hack/setup.sh diff --git a/README.md b/README.md index fdfdb071a..0773caed9 100644 --- a/README.md +++ b/README.md @@ -12,36 +12,22 @@ Postgres backup and restore plugin for [Stash by AppsCode](https://appscode.com/ Install PostgreSQL 11.2 backup or restore plugin for Stash as below. -**Chart:** - ```console helm repo add appscode https://charts.appscode.com/stable/ helm repo update helm install appscode/postgres-stash --name=postgres-stash-11.2 --version=11.2 ``` -**Script:** - -```console -curl -fsSL https://github.com/stashed/postgres/raw/11.2/hack/setup.sh | bash -``` +To install catalog for all supported PostgreSQL version, please visit [here](https://github.com/stashed/catalog). ## Uninstall Uninstall PostgreSQL 11.2 backup or restore plugin for Stash as below. -**Chart:** - ```console helm delete postgres-stash-11.2 ``` -**Script:** - -```console -curl -fsSL https://github.com/stashed/postgres/raw/11.2/hack/setup.sh | bash -s -- --uninstall -``` - ## Support We use Slack for public discussions. To chit chat with us or the rest of the community, join us in the [AppsCode Slack team](https://appscode.slack.com/messages/C8NCX6N23/details/) channel `#stash`. To sign up, use our [Slack inviter](https://slack.appscode.com/). diff --git a/chart/README.md b/chart/README.md index 8694ee7e4..05f7346af 100644 --- a/chart/README.md +++ b/chart/README.md @@ -54,28 +54,26 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the `postgre-stash` chart and their default values. -| Parameter | Description | Default | -| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -| `global.registry` | Docker registry used to pull respective images | `appscode` | -| `global.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | -| `global.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `11.2` | -| `global.backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | -| `global.restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | -| `global.metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | -| `global.metrics.labels` | Optional comma separated labels to add to the Prometheus metrics | | - -> We have declared all the configurable parameters as global parameter so that the parent chart can overwrite them. +| Parameter | Description | Default | +| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| `docker.registry` | Docker registry used to pull respective images | `appscode` | +| `docker.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | +| `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `11.2` | +| `backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | +| `restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | +| `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | +| `metrics.labels` | Optional comma separated labels to add to the Prometheus metrics | | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: ```console -helm install --name postgres-stash-11.2 --set global.metrics.enabled=false appscode/postgres-stash +helm install --name postgres-stash-11.2 --set metrics.enabled=false appscode/postgres-stash ``` -**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `global.metrics.labels`. +**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `metrics.labels`. ```console - helm install chart/postgres-stash --set global.metrics.labels="k1=v1\,k2=v2" + helm install chart/postgres-stash --set metrics.labels="k1=v1\,k2=v2" ``` diff --git a/chart/postgres-stash/templates/_helpers.tpl b/chart/postgres-stash/templates/_helpers.tpl index 453c34497..d407bbf87 100644 --- a/chart/postgres-stash/templates/_helpers.tpl +++ b/chart/postgres-stash/templates/_helpers.tpl @@ -31,10 +31,6 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{- define "postgres-stash.versionSuffix" -}} -{{- .Chart.Version | replace "." "-" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - # default labels for posgres-stash resources {{- define "postgres-stash.labels" -}} app.kubernetes.io/name: {{ include "postgres-stash.name" . }} diff --git a/chart/postgres-stash/templates/pg-backup-function.yaml b/chart/postgres-stash/templates/pg-backup-function.yaml index 6ccc2f6d4..9d8b68399 100644 --- a/chart/postgres-stash/templates/pg-backup-function.yaml +++ b/chart/postgres-stash/templates/pg-backup-function.yaml @@ -1,11 +1,11 @@ apiVersion: stash.appscode.com/v1beta1 kind: Function metadata: - name: pg-backup-{{- include "postgres-stash.versionSuffix" . }} + name: pg-backup-{{- .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: - image: {{ .Values.global.registry }}/{{ .Values.global.image }}:{{- .Values.global.tag }} + image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{- .Values.docker.tag }} args: - backup-pg # setup information @@ -19,7 +19,7 @@ spec: - --enable-cache=${ENABLE_CACHE:=true} - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit - --hostname=${HOSTNAME:=} - - --pg-args=${pgArgs:={{ .Values.global.backup.pgArgs }}} # optional arguments pass to pgdump command + - --pg-args=${pgArgs:={{ .Values.backup.pgArgs }}} # optional arguments pass to pgdump command # target information - --namespace=${NAMESPACE:=default} - --app-binding=${TARGET_NAME:=} @@ -35,10 +35,10 @@ spec: - --retention-dry-run=${RETENTION_DRY_RUN:=false} # output & metric information - --output-dir=${outputDir:=} - - --metrics-enabled={{ .Values.global.metrics.enabled }} + - --metrics-enabled={{ .Values.metrics.enabled }} - --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=} - {{- if .Values.global.metrics.labels }} - - --metrics-labels={{ .Values.global.metrics.labels | quote }} + {{- if .Values.metrics.labels }} + - --metrics-labels={{ .Values.metrics.labels | quote }} {{- end }} volumeMounts: - name: ${secretVolume} diff --git a/chart/postgres-stash/templates/pg-backup-task.yaml b/chart/postgres-stash/templates/pg-backup-task.yaml index 242cb3bb2..7878adfce 100644 --- a/chart/postgres-stash/templates/pg-backup-task.yaml +++ b/chart/postgres-stash/templates/pg-backup-task.yaml @@ -1,12 +1,12 @@ apiVersion: stash.appscode.com/v1beta1 kind: Task metadata: - name: pg-backup-{{- include "postgres-stash.versionSuffix" . }} + name: pg-backup-{{- .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: steps: - - name: pg-backup-{{- include "postgres-stash.versionSuffix" . }} + - name: pg-backup-{{- .Chart.Version }} params: - name: outputDir value: /tmp/output diff --git a/chart/postgres-stash/templates/pg-restore-function.yaml b/chart/postgres-stash/templates/pg-restore-function.yaml index 4ea9ed077..32d0f3e80 100644 --- a/chart/postgres-stash/templates/pg-restore-function.yaml +++ b/chart/postgres-stash/templates/pg-restore-function.yaml @@ -1,11 +1,11 @@ apiVersion: stash.appscode.com/v1beta1 kind: Function metadata: - name: pg-restore-{{- include "postgres-stash.versionSuffix" . }} + name: pg-restore-{{- .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: - image: {{ .Values.global.registry }}/{{ .Values.global.image }}:{{ .Values.global.tag }} + image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{ .Values.docker.tag }} args: - restore-pg # setup information @@ -19,17 +19,17 @@ spec: - --enable-cache=${ENABLE_CACHE:=true} - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit - --hostname=${HOSTNAME:=} - - --pg-args=${pgArgs:={{ .Values.global.restore.pgArgs }}} # optional arguments pass to pgdump command + - --pg-args=${pgArgs:={{ .Values.restore.pgArgs }}} # optional arguments pass to pgdump command # target information - --namespace=${NAMESPACE:=default} - --app-binding=${TARGET_NAME:=} - --snapshot=${RESTORE_SNAPSHOTS:=} # output & metric information - --output-dir=${outputDir:=} - - --metrics-enabled={{ .Values.global.metrics.enabled }} + - --metrics-enabled={{ .Values.metrics.enabled }} - --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=} - {{- if .Values.global.metrics.labels }} - - --metrics-labels={{ .Values.global.metrics.labels | quote }} + {{- if .Values.metrics.labels }} + - --metrics-labels={{ .Values.metrics.labels | quote }} {{- end }} volumeMounts: - name: ${secretVolume} diff --git a/chart/postgres-stash/templates/pg-restore-task.yaml b/chart/postgres-stash/templates/pg-restore-task.yaml index aac06a93d..ca93c4853 100644 --- a/chart/postgres-stash/templates/pg-restore-task.yaml +++ b/chart/postgres-stash/templates/pg-restore-task.yaml @@ -1,12 +1,12 @@ apiVersion: stash.appscode.com/v1beta1 kind: Task metadata: - name: pg-restore-{{- include "postgres-stash.versionSuffix" . }} + name: pg-restore-{{- .Chart.Version }} labels: {{- include "postgres-stash.labels" . | nindent 4 }} spec: steps: - - name: pg-restore-{{- include "postgres-stash.versionSuffix" . }} + - name: pg-restore-{{- .Chart.Version }} params: - name: outputDir value: /tmp/output diff --git a/chart/postgres-stash/values.yaml b/chart/postgres-stash/values.yaml index 1aaa211aa..db0aa82d4 100644 --- a/chart/postgres-stash/values.yaml +++ b/chart/postgres-stash/values.yaml @@ -3,18 +3,18 @@ # Declare variables to be passed into your templates. # we are declaring these values as global so that parent chart can overwrite them -global: +docker: registry: appscode image: postgres-stash tag: 11.2 - # optional argument to send pgdump or psql command - backup: - pgArgs: "" - restore: - pgArgs: "" +# optional argument to send pgdump or psql command +backup: + pgArgs: "" +restore: + pgArgs: "" - # default values for prometheus metrics - metrics: - enabled: true - labels: [] +# default values for prometheus metrics +metrics: + enabled: true + labels: [] diff --git a/docs/examples/backup/minimal_appbinding.yaml b/docs/examples/backup/minimal_appbinding.yaml index bd21ab331..1ba03fd8b 100644 --- a/docs/examples/backup/minimal_appbinding.yaml +++ b/docs/examples/backup/minimal_appbinding.yaml @@ -7,5 +7,6 @@ spec: clientConfig: service: name: my-database-service + port: 5432 secret: name: my-database-credentials-secret diff --git a/docs/postgres.md b/docs/postgres.md index 877428015..b91807d4d 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -232,6 +232,7 @@ spec: clientConfig: service: name: my-database-service + port: 5432 secret: name: my-database-credentials-secret ``` diff --git a/hack/setup.sh b/hack/setup.sh deleted file mode 100755 index 32865daca..000000000 --- a/hack/setup.sh +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/bash -set -eou pipefail - -OS="" -ARCH="" -DOWNLOAD_URL="" -DOWNLOAD_DIR="" -TEMP_DIRS=() - -HELM="" -CHART_NAME="postgres-stash" -CHART_LOCATION="chart" - -APPSCODE_ENV=${APPSCODE_ENV:-prod} -DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} -IMAGE_TAG=11.2 - -BACKUP_ARGS="" -RESTORE_ARGS="" - -ENABLE_PROMETHEUS_METRICS=true -METRICS_LABELS="" - -UNINSTALL=0 - -function cleanup() { - # remove temporary directories - for dir in "${TEMP_DIRS[@]}"; do - rm -rf "${dir}" - done -} - -# detect operating system -function detectOS() { - OS=$(echo $(uname) | tr '[:upper:]' '[:lower:]') - - case "$OS" in - # Minimalist GNU for Windows - cygwin* | mingw* | msys*) OS='windows' ;; - esac -} - -# detect machine architecture -function detectArch() { - ARCH=$(uname -m) - case $ARCH in - armv5*) ARCH="armv5" ;; - armv6*) ARCH="armv6" ;; - armv7*) ARCH="arm" ;; - aarch64) ARCH="arm64" ;; - x86) ARCH="386" ;; - x86_64) ARCH="amd64" ;; - i686) ARCH="386" ;; - i386) ARCH="386" ;; - esac -} - -detectOS -detectArch - -# download file pointed by DOWNLOAD_URL variable -# store download file to the directory pointed by DOWNLOAD_DIR variable -# you have to sent the output file name as argument. i.e. downloadFile myfile.tar.gz -function downloadFile() { - if curl --output /dev/null --silent --head --fail "${DOWNLOAD_URL}"; then - curl -fsSL ${DOWNLOAD_URL} -o ${DOWNLOAD_DIR}/$1 - else - echo "File does not exist" - exit 1 - fi -} - -trap cleanup EXIT - -show_help() { - echo "install.sh - install postgres-stash catalog for stash" - echo " " - echo "install.sh [options]" - echo " " - echo "options:" - echo "-h, --help show brief help" - echo " --docker-registry docker registry used to pull postgres-stash images (default: appscode)" - echo " --image-tag tag to use to pull postgres-stash docker image" - echo " --backup-args optional arguments to pass to pgdump command during backup" - echo " --restore-args optional arguments to pass to psql command during restore" - echo " --metrics-enabled specify whether to send prometheus metrics during backup or restore (default: true)" - echo " --metrics-labels labels to apply to prometheus metrics for backup or restore process (format: k1=v1,k2=v2)" - echo " --uninstall uninstall postgres-stash catalog" -} - -while test $# -gt 0; do - case "$1" in - -h | --help) - show_help - exit 0 - ;; - --docker-registry*) - DOCKER_REGISTRY=$(echo $1 | sed -e 's/^[^=]*=//g') - shift - ;; - --image-tag*) - IMAGE_TAG=$(echo $1 | sed -e 's/^[^=]*=//g') - shift - ;; - --backup-args*) - BACKUP_ARGS=$(echo $1 | sed -e 's/^[^=]*=//g') - shift - ;; - --restore-args*) - RESTORE_ARGS=$(echo $1 | sed -e 's/^[^=]*=//g') - shift - ;; - --metrics-enabled*) - val=$(echo $1 | sed -e 's/^[^=]*=//g') - if [[ "$val" == "false" ]]; then - ENABLE_PROMETHEUS_METRICS=false - fi - shift - ;; - --metrics-labels*) - METRICS_LABELS=$(echo $1 | sed -e 's/^[^=]*=//g') - shift - ;; - --uninstall) - UNINSTALL=1 - shift - ;; - *) - echo "unknown flag: $1" - echo " " - show_help - exit 1 - ;; - esac -done - -# Download helm if already not installed -if [ -x "$(command -v helm)" ]; then - HELM=helm -else - echo "Helm is not installed!. Downloading Helm." - ARTIFACT="https://get.helm.sh" - HELM_VERSION="v2.14.1" - HELM_BIN=helm - HELM_DIST=${HELM_BIN}-${HELM_VERSION}-${OS}-${ARCH}.tar.gz - - case "$OS" in - cygwin* | mingw* | msys*) - HELM_BIN=${HELM_BIN}.exe - ;; - esac - - DOWNLOAD_URL=${ARTIFACT}/${HELM_DIST} - DOWNLOAD_DIR="$(mktemp -dt helm-XXXXXX)" - TEMP_DIRS+=($DOWNLOAD_DIR) - - downloadFile ${HELM_DIST} - - tar xf ${DOWNLOAD_DIR}/${HELM_DIST} -C ${DOWNLOAD_DIR} - HELM=${DOWNLOAD_DIR}/${OS}-${ARCH}/${HELM_BIN} - chmod +x $HELM -fi - -if [[ "$APPSCODE_ENV" == "dev" ]]; then - CHART_LOCATION="chart" -else - # download chart from remove repository and extract into a temporary directory - CHART_LOCATION="$(mktemp -dt appscode-XXXXXX)" - TEMP_DIRS+=(${CHART_LOCATION}) - TEMP_INSTALLER_REPO="${CHART_NAME}-installer" - $HELM repo add "${TEMP_INSTALLER_REPO}" "https://charts.appscode.com/stable" - $HELM fetch --untar --untardir ${CHART_LOCATION} "${TEMP_INSTALLER_REPO}/${CHART_NAME}" - $HELM repo remove "${TEMP_INSTALLER_REPO}" -fi - -if [ "$UNINSTALL" -eq 1 ]; then - $HELM template ${CHART_LOCATION}/${CHART_NAME} \ - | kubectl delete -f - - - echo " " - echo "Successfully uninstalled postgres-stash catalog" -else -# render the helm template and apply the resulting YAML -$HELM template ${CHART_LOCATION}/${CHART_NAME} \ - --set global.registry=${DOCKER_REGISTRY} \ - --set global.tag=${IMAGE_TAG} \ - --set global.backup.pgArgs=${BACKUP_ARGS} \ - --set global.restore.pgArgs=${RESTORE_ARGS} \ - --set global.metrics.enabled=${ENABLE_PROMETHEUS_METRICS} \ - --set global.metrics.labels=${METRICS_LABELS} \ -| kubectl apply -f - - -echo " " -echo "Successfully installed postgres-stash catalog" -fi From a23c0fb1e013bbe936f7d75beb5fe9e732647fbf Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 21 Jul 2019 03:58:09 -0700 Subject: [PATCH 22/25] make file fixes --- Makefile | 51 +++++++++++++++++++++++++++++++++++++++------------ hack/build.sh | 16 ++++++++++++++++ hack/fmt.sh | 16 ++++++++++++++++ hack/test.sh | 16 ++++++++++++++++ 4 files changed, 87 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 0542dd085..c57c63663 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,18 @@ +# Copyright 2019 AppsCode Inc. +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + SHELL=/bin/bash -o pipefail # The binary to build (just the basename). @@ -54,7 +69,7 @@ TAG := $(VERSION)_$(OS)_$(ARCH) TAG_PROD := $(TAG) TAG_DBG := $(VERSION)-dbg_$(OS)_$(ARCH) -GO_VERSION ?= 1.12.5 +GO_VERSION ?= 1.12.7 BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)-stretch OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) @@ -164,9 +179,21 @@ $(OUTBIN): .go/$(OUTBIN).stamp commit_timestamp=$(commit_timestamp) \ ./hack/build.sh \ " - @if [ $(COMPRESS) = yes ] && [ $(OS) != windows ]; then \ - echo "compressing $(OUTBIN)"; \ - upx --brute .go/$(OUTBIN); \ + @if [ $(COMPRESS) = yes ] && [ $(OS) != darwin ]; then \ + echo "compressing $(OUTBIN)"; \ + docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + $(BUILD_IMAGE) \ + upx --brute /go/$(OUTBIN); \ fi @if ! cmp -s .go/$(OUTBIN) $(OUTBIN); then \ mv .go/$(OUTBIN) $(OUTBIN); \ @@ -255,28 +282,28 @@ dev: gen fmt push ci: lint test build #cover .PHONY: qa -qa: docker-manifest +qa: @if [ "$$APPSCODE_ENV" = "prod" ]; then \ echo "Nothing to do in prod env. Are you trying to 'release' binaries to prod?"; \ exit 1; \ fi - @if [ "$(version_strategy)" = "git_tag" ]; then \ + @if [ "$(version_strategy)" = "tag" ]; then \ echo "Are you trying to 'release' binaries to prod?"; \ exit 1; \ fi - @$(MAKE) clean all-push --no-print-directory + @$(MAKE) clean all-push docker-manifest --no-print-directory .PHONY: release -release: docker-manifest +release: @if [ "$$APPSCODE_ENV" != "prod" ]; then \ echo "'release' only works in PROD env."; \ exit 1; \ fi - @if [ "$(version_strategy)" != "git_tag" ]; then \ - echo "'apply_tag' to release binaries and/or docker images."; \ - exit 1; \ + @if [ "$(version_strategy)" != "tag" ]; then \ + echo "apply tag to release binaries and/or docker images."; \ + exit 1; \ fi - @$(MAKE) clean all-push --no-print-directory + @$(MAKE) clean all-push docker-manifest --no-print-directory .PHONY: clean clean: diff --git a/hack/build.sh b/hack/build.sh index 518c73d1b..84ba58ebc 100755 --- a/hack/build.sh +++ b/hack/build.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash + +# Copyright 2019 AppsCode Inc. +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -eou pipefail if [ -z "${OS:-}" ]; then diff --git a/hack/fmt.sh b/hack/fmt.sh index 5a403cfad..0e8cd28fd 100755 --- a/hack/fmt.sh +++ b/hack/fmt.sh @@ -1,4 +1,19 @@ #!/usr/bin/env bash + +# Copyright 2019 AppsCode Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -eou pipefail export CGO_ENABLED=0 @@ -20,3 +35,4 @@ echo echo "Running gofmt:" cmd="gofmt -s -w ${TARGETS}" echo $cmd; $cmd +echo diff --git a/hack/test.sh b/hack/test.sh index 0d9aa03f0..802956ce8 100755 --- a/hack/test.sh +++ b/hack/test.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash + +# Copyright 2019 AppsCode Inc. +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -eou pipefail export CGO_ENABLED=0 From 6b52da771e3494d80a90ebce7fcf30420226d5c9 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 21 Jul 2019 04:51:44 -0700 Subject: [PATCH 23/25] fix --- README.md | 2 +- chart/{ => postgres-stash}/README.md | 8 ++++---- docs/postgres.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename chart/{ => postgres-stash}/README.md (90%) diff --git a/README.md b/README.md index 0773caed9..d0f78b868 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ helm repo update helm install appscode/postgres-stash --name=postgres-stash-11.2 --version=11.2 ``` -To install catalog for all supported PostgreSQL version, please visit [here](https://github.com/stashed/catalog). +To install catalog for all supported PostgreSQL versions, please visit [here](https://github.com/stashed/catalog). ## Uninstall diff --git a/chart/README.md b/chart/postgres-stash/README.md similarity index 90% rename from chart/README.md rename to chart/postgres-stash/README.md index 05f7346af..9f0ae9899 100644 --- a/chart/README.md +++ b/chart/postgres-stash/README.md @@ -1,6 +1,6 @@ # Postgres-stash -[postgres-stash by AppsCode](https://github.com/stashed/postgres-stash) - PostgreSQL database backup/restore plugin for [Stash](https://github.com/stashed/). +[postgres-stash](https://github.com/stashed/postgres-stash) - PostgreSQL database backup/restore plugin for [Stash](https://appscode.com/products/stash/) by AppsCode. ## TL;DR; @@ -16,7 +16,7 @@ This chart installs necessary `Function` and `Task` definition to backup or rest ## Prerequisites -- Kubernetes 1.9+ +- Kubernetes 1.11+ ## Installing the Chart @@ -59,8 +59,8 @@ The following table lists the configurable parameters of the `postgre-stash` cha | `docker.registry` | Docker registry used to pull respective images | `appscode` | | `docker.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | | `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `11.2` | -| `backup.pgArgs` | Optional arguments to pass to `pgdump` command while bakcup | | -| `restore.pgArgs` | Optional arguments to pass to `psql` command while restore | | +| `backup.pgArgs` | Optional arguments to pass to `pgdump` command for bakcup | | +| `restore.pgArgs` | Optional arguments to pass to `psql` command for restoration | | | `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | | `metrics.labels` | Optional comma separated labels to add to the Prometheus metrics | | diff --git a/docs/postgres.md b/docs/postgres.md index b91807d4d..4e3841944 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -14,7 +14,7 @@ section_menu_id: guides # Backup and Restore PostgreSQL database using Stash -Stash supports backup and restores PostgreSQL database. This guide will show you how you can backup and restore your PostgreSQL database with Stash. +Stash 0.9.0+ supports backup and restoration of PostgreSQL databases. This guide will show you how you can backup and restore your PostgreSQL database with Stash. ## Before You Begin From 857182571f8b2640de2d24e62248533d22fa3326 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 21 Jul 2019 05:15:22 -0700 Subject: [PATCH 24/25] fix --- chart/postgres-stash/templates/NOTES.txt | 4 +- docs/postgres.md | 68 ++++++++++++------------ 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/chart/postgres-stash/templates/NOTES.txt b/chart/postgres-stash/templates/NOTES.txt index 7cf46a615..de5b62193 100644 --- a/chart/postgres-stash/templates/NOTES.txt +++ b/chart/postgres-stash/templates/NOTES.txt @@ -1,7 +1,7 @@ To verify that all Functions are installed successfully, run: - kubectl get functions + kubectl get function.stash.appscode.com To verify that all Tasks are installed successfully, run: - kubectl get task \ No newline at end of file + kubectl get task.stash.appscode.com \ No newline at end of file diff --git a/docs/postgres.md b/docs/postgres.md index 4e3841944..46b71f2e9 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -42,7 +42,7 @@ $ kubectl create ns demo namespace/demo created ``` ->Note: YAML files used in this tutorial are stored [here](https://github.com/stashed/postgres/examples/). +> Note: YAML files used in this tutorial are stored [here](https://github.com/stashed/postgres/examples/). ## Install Postgres Catalog for Stash @@ -61,7 +61,7 @@ helm install appscode/postgres-catalog --name postgres-catalog Once installed, this will create `pg-backup-*` and `pg-recovery-*` Functions for all supported PostgreSQL versions. Verify that the Functions has been created successfully by, ```console -$ kubectl get function +$ kubectl get function.stash.appscode.com NAME AGE pg-backup-9.6 6s pg-backup-10.2 6s @@ -79,7 +79,7 @@ update-status 6d19h This will also create `pg-backup-*` and `pg-restore-*` Tasks for all supported PostgreSQL versions. Verify that they have been created successfully by, ```console -$ kubectl get task +$ kubectl get task.stash.appscode.com NAME AGE NAME AGE pg-backup-9.6 10s @@ -98,7 +98,7 @@ Now, Stash is ready to backup PostgreSQL database. ## Backup PostgreSQL -This section will demonstrate how to backup PostgreSQL databse. We are going to use [KubeDB](https://kubedb.com) to deploy a sample database. You can deploy your database using any method you want. We are using `KubeDB` because it automates some tasks that you have to do manually otherwise. +This section will demonstrate how to backup PostgreSQL database. We are going to use [KubeDB](https://kubedb.com) to deploy a sample database. You can deploy your database using any method you want. We are using `KubeDB` because it automates some tasks that you have to do manually otherwise. ### Deploy Sample PosgreSQL Database @@ -120,7 +120,7 @@ spec: storage: storageClassName: "standard" accessModes: - - ReadWriteOnce + - ReadWriteOnce resources: requests: storage: 1Gi @@ -179,7 +179,6 @@ $ kubectl get appbindings -n demo sample-postgres -o yaml apiVersion: appcatalog.appscode.com/v1alpha1 kind: AppBinding metadata: -... name: sample-postgres namespace: demo labels: @@ -190,7 +189,6 @@ metadata: app.kubernetes.io/version: "11.2" kubedb.com/kind: Postgres kubedb.com/name: sample-postgres -... spec: clientConfig: service: @@ -202,12 +200,12 @@ spec: secret: name: sample-postgres-auth secretTransforms: - - renameKey: - from: POSTGRES_USER - to: username - - renameKey: - from: POSTGRES_PASSWORD - to: password + - renameKey: + from: POSTGRES_USER + to: username + - renameKey: + from: POSTGRES_PASSWORD + to: password type: kubedb.com/postgres ``` @@ -239,7 +237,7 @@ spec: **Insert Sample Data:** -Now, we will exec into the database pod and create some sample data. At first, find out the database pod using the following command, +Now, we are going to exec into the database pod and create some sample data. At first, find out the database pod using the following command, ```console $ kubectl get pods -n demo --selector="kubedb.com/name=sample-postgres" @@ -259,9 +257,9 @@ Type "help" for help. # list available databases postgres=# \l List of databases - Name | Owner | Encoding | Collate | Ctype | Access privileges + Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+------------+------------+----------------------- - postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | + postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + @@ -279,7 +277,7 @@ CREATE TABLE # list tables postgres=# \d List of relations - Schema | Name | Type | Owner + Schema | Name | Type | Owner --------+---------+-------+---------- public | company | table | postgres (1 row) @@ -372,7 +370,7 @@ spec: Here, - `spec.schedule` specifies that we want to backup the database at 5 minutes interval. -- `spec.task.name` specifies the name of the task crd that specifies the necessary Function and their execution order to backup a PostgreSQL databse. +- `spec.task.name` specifies the name of the task crd that specifies the necessary Function and their execution order to backup a PostgreSQL database. - `spec.target.ref` refers to the `AppBinding` crd that was created for `sample-postgres` database. Let's create the `BackupConfiguration` crd we have shown above, @@ -396,7 +394,7 @@ sample-postgres-backup */5 * * * * False 0 61s **Wait for BackupSession:** -The `sample-postgres-backup` CronJob will trigger a backup on each schedule by creating a `BackpSession` crd. +The `sample-postgres-backup` CronJob will trigger a backup on each scheduled slot by creating a `BackupSession` crd. Wait for a schedule to appear. Run the following command to watch `BackupSession` crd, @@ -407,11 +405,11 @@ sample-postgres-backup-1560350521 sample-postgres-backup Running 5m19s sample-postgres-backup-1560350521 sample-postgres-backup Succeeded 5m45s ``` -We can see above that the backup session has succeeded. Now, we will verify that the backed up data has been stored in the backend. +We can see above that the backup session has succeeded. Now, we are going to verify that the backed up data has been stored in the backend. **Verify Backup:** -Once a backup is complete, Stash will update the respective `Repository` crd to reflect the backup. Check that the repository `gcs-repo` has been updated by the following command, +Once a backup is complete, Stash will update the respective `Repository` crd to reflect the backup completion. Check that the repository `gcs-repo` has been updated by the following command, ```console $ kubectl get repository -n demo gcs-repo @@ -419,24 +417,24 @@ NAME INTEGRITY SIZE SNAPSHOT-COUNT LAST-SUCCESSFUL-BACKUP AGE gcs-repo true 3.441 KiB 1 31s 17m ``` -Now, if we navigate to the GCS bucket, we will see backed up data has been stored in `demo/postgres/sample-postgres` directory as specified by `spec.backend.gcs.prefix` field of Repository crd. +Now, if we navigate to the GCS bucket, we are going to see backed up data has been stored in `demo/postgres/sample-postgres` directory as specified by `spec.backend.gcs.prefix` field of Repository crd.
  Backup data in GCS Bucket
Fig: Backup data in GCS Bucket
->Note: Stash keeps all the backed up data encrypted. So, data in the backend will not make any sense until they are decrypted. +> Note: Stash keeps all the backed up data encrypted. So, data in the backend will not make any sense until they are decrypted. ## Restore PostgreSQL -We will restore the database from the backup we have taken in the previous section. We will deploy a new database and initialize it from the backup. +We are going to restore the database from the backup we have taken in the previous section. We are going to deploy a new database and initialize it from the backup. **Deploy Restored Database:** Now, we have to deploy the restored database similarly as we have deployed the original `sample-psotgres` database. However, this time there will be the following differences: -- We have to use the same secret that was used in the original database. We will specify it using `spec.databaseSecret` field. +- We have to use the same secret that was used in the original database. We are going to specify it using `spec.databaseSecret` field. - We have to specify `spec.init` section to tell KubeDB that we are going to use Stash to initialize this database from backup. KubeDB will keep the database phase to `Initializing` until Stash finishes its initialization. Below is the YAML for `Postgres` crd we are going deploy to initialize from backup, @@ -455,7 +453,7 @@ spec: storage: storageClassName: "standard" accessModes: - - ReadWriteOnce + - ReadWriteOnce resources: requests: storage: 1Gi @@ -496,7 +494,7 @@ NAME AGE restored-postgres 9m59s ``` ->If you are not using KubeDB to deploy database, create the AppBinding manually. +> If you are not using KubeDB to deploy database, create the AppBinding manually. Below is the YAML for the `RestoreSession` crd that we are going to create to restore backed up data into `restored-postgres` database. @@ -519,7 +517,7 @@ spec: kind: AppBinding name: restored-postgres rules: - - snapshots: [latest] + - snapshots: [latest] ``` Here, @@ -527,10 +525,10 @@ Here, - `metadata.labels` specifies a `kubedb.com/kind: Postgres` label that is used by KubeDB to watch this `RestoreSession`. - `spec.task.name` specifies the name of the `Task` crd that specifies the Functions and their execution order to restore a PostgreSQL database. - `spec.repository.name` specifies the `Repository` crd that holds the backend information where our backed up data has been stored. -- `spec.target.ref` refers to the AppBinding crd for the `restored-postgres` databse. +- `spec.target.ref` refers to the AppBinding crd for the `restored-postgres` database. - `spec.rules` specifies that we are restoring from the latest backup snapshot of the database. -> **Warning:** Label `kubedb.com/kind: Postgres` is mandatory if you are uisng KubeDB to deploy the databse. Otherwise, the database will be stuck in `Initializing` state. +> **Warning:** Label `kubedb.com/kind: Postgres` is mandatory if you are using KubeDB to deploy the database. Otherwise, the database will be stuck in `Initializing` state. Let's create the `RestoreSession` crd we have shown above, @@ -539,7 +537,7 @@ $ kubectl apply -f ./docs/examples/restore/restoresession.yaml restoresession.stash.appscode.com/sample-postgres-restore created ``` -Once, you have created the `RestoreSession` crd, Stash will create a job to restore. We can watch the `RestoreSession` phase to check if the restore process is succeeded or not. +Once, you have created the `RestoreSession` crd, Stash will create a restore job. We can watch the `RestoreSession` phase to check if the restore process has succeeded or not. Run the following command to watch `RestoreSession` phase, @@ -554,7 +552,7 @@ So, we can see from the output of the above command that the restore process suc **Verify Restored Data:** -In this section, we will verify that the desired data has been restored successfully. We will connect to the database and check whether the table we had created in the original database is restored or not. +In this section, we are going to verify that the desired data has been restored successfully. We are going to connect to the database and check whether the table we had created in the original database is restored or not. At first, check if the database has gone into `Running` state by the following command, @@ -584,9 +582,9 @@ Type "help" for help. # list available databases postgres=# \l List of databases - Name | Owner | Encoding | Collate | Ctype | Access privileges + Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+------------+------------+----------------------- - postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | + postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 | template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres + @@ -600,7 +598,7 @@ You are now connected to database "postgres" as user "postgres". # check the table we had created in the original database has been restored here postgres=# \d List of relations - Schema | Name | Type | Owner + Schema | Name | Type | Owner --------+---------+-------+---------- public | company | table | postgres (1 row) From 931d934135c12fb85f97858e20ec033d05eb1636 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Sun, 21 Jul 2019 05:23:38 -0700 Subject: [PATCH 25/25] revendor azure deps --- go.mod | 21 +- go.sum | 304 +++++++----- .../exporter/ocagent/connection.go | 36 +- .../exporter/ocagent/go.mod | 6 +- .../exporter/ocagent/go.sum | 75 ++- .../exporter/ocagent/ocagent.go | 60 +-- .../exporter/ocagent/options.go | 16 - .../Azure/go-autorest/{ => autorest}/LICENSE | 0 .../Azure/go-autorest/autorest/adal/LICENSE | 191 ++++++++ .../Azure/go-autorest/autorest/adal/config.go | 62 ++- .../Azure/go-autorest/autorest/adal/go.mod | 11 + .../Azure/go-autorest/autorest/adal/go.sum | 139 ++++++ .../Azure/go-autorest/autorest/adal/token.go | 70 +++ .../go-autorest/autorest/authorization.go | 49 ++ .../autorest/azure/environments.go | 5 + .../Azure/go-autorest/autorest/client.go | 16 + .../Azure/go-autorest/autorest/date/LICENSE | 191 ++++++++ .../Azure/go-autorest/autorest/date/go.mod | 3 + .../Azure/go-autorest/autorest/go.mod | 12 + .../Azure/go-autorest/autorest/go.sum | 143 ++++++ .../Azure/go-autorest/autorest/preparer.go | 52 +- .../Azure/go-autorest/autorest/responder.go | 19 + .../Azure/go-autorest/autorest/sender.go | 130 +++-- .../Azure/go-autorest/autorest/version.go | 2 +- .../Azure/go-autorest/logger/LICENSE | 191 ++++++++ .../Azure/go-autorest/logger/go.mod | 3 + .../Azure/go-autorest/tracing/LICENSE | 191 ++++++++ .../Azure/go-autorest/tracing/go.mod | 8 + .../Azure/go-autorest/tracing/go.sum | 130 +++++ .../github.com/appscode/jsonpatch/.gitignore | 26 - .../github.com/appscode/jsonpatch/.travis.yml | 10 - .../github.com/appscode/jsonpatch/README.md | 53 --- vendor/github.com/appscode/jsonpatch/go.mod | 8 - vendor/github.com/appscode/jsonpatch/go.sum | 8 - vendor/github.com/evanphx/json-patch/patch.go | 204 +++++--- .../client_golang/prometheus/build_info.go | 29 ++ .../prometheus/build_info_pre_1.12.go | 22 + .../client_golang/prometheus/go_collector.go | 32 +- .../prometheus/process_collector.go | 6 +- .../client_golang/prometheus/summary.go | 8 +- vendor/github.com/prometheus/procfs/README.md | 11 +- .../github.com/prometheus/procfs/buddyinfo.go | 12 +- .../prometheus/procfs/fixtures.ttar | 33 +- vendor/github.com/prometheus/procfs/fs.go | 6 + vendor/github.com/prometheus/procfs/ipvs.go | 28 +- vendor/github.com/prometheus/procfs/mdstat.go | 74 +-- .../prometheus/procfs/mountstats.go | 28 +- .../github.com/prometheus/procfs/net_dev.go | 18 +- .../github.com/prometheus/procfs/net_unix.go | 275 +++++++++++ vendor/github.com/prometheus/procfs/proc.go | 11 +- .../github.com/prometheus/procfs/proc_io.go | 4 +- .../prometheus/procfs/proc_limits.go | 7 + .../github.com/prometheus/procfs/proc_ns.go | 4 +- .../github.com/prometheus/procfs/proc_psi.go | 17 +- .../github.com/prometheus/procfs/proc_stat.go | 9 +- vendor/github.com/prometheus/procfs/stat.go | 36 +- .../robfig/cron/v3}/.gitignore | 0 .../robfig/cron/v3}/.travis.yml | 0 .../robfig/cron/v3}/LICENSE | 0 vendor/github.com/robfig/cron/v3/README.md | 125 +++++ vendor/github.com/robfig/cron/v3/chain.go | 92 ++++ .../robfig/cron/v3}/constantdelay.go | 0 vendor/github.com/robfig/cron/v3/cron.go | 350 ++++++++++++++ .../robfig/cron/v3}/doc.go | 120 ++++- vendor/github.com/robfig/cron/v3/go.mod | 3 + vendor/github.com/robfig/cron/v3/logger.go | 86 ++++ vendor/github.com/robfig/cron/v3/option.go | 45 ++ vendor/github.com/robfig/cron/v3/parser.go | 434 +++++++++++++++++ .../robfig/cron/v3}/spec.go | 39 +- vendor/github.com/spf13/cobra/.gitignore | 2 + vendor/github.com/spf13/cobra/README.md | 9 +- .../spf13/cobra/bash_completions.go | 48 -- vendor/github.com/spf13/cobra/command.go | 97 +++- .../spf13/cobra/powershell_completions.go | 100 ++++ .../spf13/cobra/powershell_completions.md | 14 + .../spf13/cobra/shell_completions.go | 85 ++++ .../github.com/spf13/cobra/zsh_completions.go | 358 +++++++++++--- .../github.com/spf13/cobra/zsh_completions.md | 39 ++ vendor/go.opencensus.io/README.md | 6 +- vendor/go.opencensus.io/go.mod | 14 +- vendor/go.opencensus.io/go.sum | 27 +- vendor/go.opencensus.io/opencensus.go | 2 +- .../go.opencensus.io/plugin/ocgrpc/client.go | 2 +- .../plugin/ocgrpc/client_stats_handler.go | 2 +- .../go.opencensus.io/plugin/ocgrpc/server.go | 2 +- .../plugin/ocgrpc/server_stats_handler.go | 2 +- .../plugin/ocgrpc/trace_common.go | 2 +- .../stats/view/view_to_metric.go | 4 +- vendor/go.opencensus.io/tag/key.go | 10 + vendor/golang.org/x/net/http2/server.go | 26 +- vendor/golang.org/x/oauth2/google/google.go | 11 +- .../golang.org/x/sys/unix/asm_linux_riscv64.s | 54 +++ vendor/golang.org/x/sys/unix/mkall.sh | 8 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 3 +- vendor/golang.org/x/sys/unix/mkpost.go | 4 +- vendor/golang.org/x/sys/unix/mksysnum.go | 2 +- .../x/sys/unix/readdirent_getdents.go | 12 + .../x/sys/unix/readdirent_getdirentries.go | 19 + vendor/golang.org/x/sys/unix/syscall_aix.go | 2 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 12 +- .../x/sys/unix/syscall_dragonfly.go | 1 + .../golang.org/x/sys/unix/syscall_freebsd.go | 82 +++- vendor/golang.org/x/sys/unix/syscall_linux.go | 19 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 25 +- .../golang.org/x/sys/unix/syscall_openbsd.go | 25 +- .../golang.org/x/sys/unix/syscall_solaris.go | 1 + vendor/golang.org/x/sys/unix/types_freebsd.go | 50 +- vendor/golang.org/x/sys/unix/types_netbsd.go | 1 + vendor/golang.org/x/sys/unix/types_openbsd.go | 1 + .../x/sys/unix/zerrors_linux_386.go | 50 ++ .../x/sys/unix/zerrors_linux_amd64.go | 50 ++ .../x/sys/unix/zerrors_linux_arm.go | 50 ++ .../x/sys/unix/zerrors_linux_arm64.go | 50 ++ .../x/sys/unix/zerrors_linux_mips.go | 50 ++ .../x/sys/unix/zerrors_linux_mips64.go | 50 ++ .../x/sys/unix/zerrors_linux_mips64le.go | 50 ++ .../x/sys/unix/zerrors_linux_mipsle.go | 50 ++ .../x/sys/unix/zerrors_linux_ppc64.go | 50 ++ .../x/sys/unix/zerrors_linux_ppc64le.go | 50 ++ .../x/sys/unix/zerrors_linux_riscv64.go | 50 ++ .../x/sys/unix/zerrors_linux_s390x.go | 50 ++ .../x/sys/unix/zerrors_linux_sparc64.go | 50 ++ .../x/sys/unix/zsyscall_dragonfly_amd64.go | 17 + .../x/sys/unix/zsyscall_freebsd_386.go | 12 +- .../x/sys/unix/zsyscall_freebsd_amd64.go | 12 +- .../x/sys/unix/zsyscall_freebsd_arm.go | 12 +- .../x/sys/unix/zsyscall_freebsd_arm64.go | 12 +- .../x/sys/unix/zsyscall_linux_386.go | 28 +- .../x/sys/unix/zsyscall_linux_amd64.go | 28 +- .../x/sys/unix/zsyscall_linux_arm.go | 28 +- .../x/sys/unix/zsyscall_linux_arm64.go | 28 +- .../x/sys/unix/zsyscall_linux_mips.go | 28 +- .../x/sys/unix/zsyscall_linux_mips64.go | 28 +- .../x/sys/unix/zsyscall_linux_mips64le.go | 28 +- .../x/sys/unix/zsyscall_linux_mipsle.go | 28 +- .../x/sys/unix/zsyscall_linux_ppc64.go | 28 +- .../x/sys/unix/zsyscall_linux_ppc64le.go | 28 +- .../x/sys/unix/zsyscall_linux_riscv64.go | 28 +- .../x/sys/unix/zsyscall_linux_s390x.go | 28 +- .../x/sys/unix/zsyscall_linux_sparc64.go | 28 +- .../x/sys/unix/zsyscall_netbsd_386.go | 2 +- .../x/sys/unix/zsyscall_netbsd_amd64.go | 2 +- .../x/sys/unix/zsyscall_netbsd_arm.go | 2 +- .../x/sys/unix/zsyscall_netbsd_arm64.go | 2 +- .../x/sys/unix/zsyscall_openbsd_386.go | 2 +- .../x/sys/unix/zsyscall_openbsd_amd64.go | 2 +- .../x/sys/unix/zsyscall_openbsd_arm.go | 2 +- .../x/sys/unix/zsyscall_openbsd_arm64.go | 2 +- .../x/sys/unix/zsysnum_freebsd_386.go | 23 +- .../x/sys/unix/zsysnum_freebsd_amd64.go | 23 +- .../x/sys/unix/zsysnum_freebsd_arm.go | 23 +- .../x/sys/unix/zsysnum_freebsd_arm64.go | 445 +++++++++--------- .../x/sys/unix/ztypes_freebsd_386.go | 103 +++- .../x/sys/unix/ztypes_freebsd_amd64.go | 110 ++++- .../x/sys/unix/ztypes_freebsd_arm.go | 87 +++- .../x/sys/unix/ztypes_freebsd_arm64.go | 88 +++- .../golang.org/x/sys/unix/ztypes_linux_386.go | 19 + .../x/sys/unix/ztypes_linux_amd64.go | 19 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 19 + .../x/sys/unix/ztypes_linux_arm64.go | 19 + .../x/sys/unix/ztypes_linux_mips.go | 19 + .../x/sys/unix/ztypes_linux_mips64.go | 19 + .../x/sys/unix/ztypes_linux_mips64le.go | 19 + .../x/sys/unix/ztypes_linux_mipsle.go | 19 + .../x/sys/unix/ztypes_linux_ppc64.go | 19 + .../x/sys/unix/ztypes_linux_ppc64le.go | 19 + .../x/sys/unix/ztypes_linux_riscv64.go | 19 + .../x/sys/unix/ztypes_linux_s390x.go | 19 + .../x/sys/unix/ztypes_linux_sparc64.go | 19 + .../x/sys/unix/ztypes_netbsd_386.go | 1 + .../x/sys/unix/ztypes_netbsd_amd64.go | 1 + .../x/sys/unix/ztypes_netbsd_arm.go | 1 + .../x/sys/unix/ztypes_netbsd_arm64.go | 1 + .../x/sys/unix/ztypes_openbsd_386.go | 1 + .../x/sys/unix/ztypes_openbsd_amd64.go | 1 + .../x/sys/unix/ztypes_openbsd_arm.go | 1 + .../x/sys/unix/ztypes_openbsd_arm64.go | 1 + vendor/golang.org/x/sys/windows/mkerrors.bash | 5 +- vendor/golang.org/x/sys/windows/mkerrors.go | 9 - .../x/sys/windows/mkknownfolderids.bash | 27 ++ .../x/sys/windows/security_windows.go | 77 ++- vendor/golang.org/x/sys/windows/service.go | 7 + .../x/sys/windows/syscall_windows.go | 101 +++- .../golang.org/x/sys/windows/types_windows.go | 232 ++++++++- .../x/sys/windows/zerrors_windows.go | 2 +- .../x/sys/windows/zknownfolderids_windows.go | 149 ++++++ .../x/sys/windows/zsyscall_windows.go | 330 ++++++++++++- .../jsonpatch/v2}/LICENSE | 0 vendor/gomodules.xyz/jsonpatch/v2/go.mod | 9 + vendor/gomodules.xyz/jsonpatch/v2/go.sum | 11 + .../jsonpatch/v2}/jsonpatch.go | 8 +- vendor/google.golang.org/appengine/README.md | 4 +- vendor/google.golang.org/appengine/go.mod | 9 +- vendor/google.golang.org/appengine/go.sum | 16 + .../googleapis/api/httpbody/httpbody.pb.go | 26 +- .../googleapis/rpc/status/status.pb.go | 26 +- .../protobuf/field_mask/field_mask.pb.go | 26 +- vendor/google.golang.org/grpc/CONTRIBUTING.md | 57 ++- vendor/google.golang.org/grpc/README.md | 76 ++- .../grpc/balancer/balancer.go | 6 + .../grpc/balancer_v1_wrapper.go | 13 +- vendor/google.golang.org/grpc/clientconn.go | 67 +++ vendor/google.golang.org/grpc/codes/codes.go | 3 +- vendor/google.golang.org/grpc/dialoptions.go | 36 +- vendor/google.golang.org/grpc/go.mod | 1 + vendor/google.golang.org/grpc/go.sum | 2 + .../grpc/internal/channelz/funcs.go | 30 +- .../grpc/internal/transport/http2_client.go | 39 +- .../grpc/internal/transport/transport.go | 13 +- .../google.golang.org/grpc/picker_wrapper.go | 8 + vendor/google.golang.org/grpc/preloader.go | 64 +++ .../grpc/resolver/dns/dns_resolver.go | 19 + .../grpc/resolver/resolver.go | 15 + vendor/google.golang.org/grpc/rpc_util.go | 26 +- vendor/google.golang.org/grpc/server.go | 116 +++-- vendor/google.golang.org/grpc/stream.go | 53 ++- vendor/google.golang.org/grpc/version.go | 2 +- vendor/google.golang.org/grpc/vet.sh | 4 +- vendor/gopkg.in/robfig/cron.v2/README.md | 1 - vendor/gopkg.in/robfig/cron.v2/cron.go | 237 ---------- vendor/gopkg.in/robfig/cron.v2/parser.go | 246 ---------- vendor/kmodules.xyz/client-go/README.md | 2 +- .../client-go/core/v1/kubernetes.go | 27 ++ vendor/kmodules.xyz/client-go/go.mod | 39 +- vendor/kmodules.xyz/client-go/go.sum | 262 +++++++++-- vendor/kmodules.xyz/client-go/meta/patch.go | 2 +- .../offshoot-api/util/runtime_settings.go | 110 +++++ vendor/modules.txt | 66 +-- .../stash/apis/constants.go | 3 + .../stash/apis/stash/v1alpha1/validator.go | 4 +- .../stash/apis/stash/v1beta1/annotations.go | 4 +- .../v1beta1/backup_configuration_helpers.go | 23 +- .../stash/v1beta1/restore_session_helpers.go | 13 +- .../stash/apis/stash/v1beta1/types_helpers.go | 5 + vendor/stash.appscode.dev/stash/apis/util.go | 10 +- .../stash/v1beta1/util/backupconfiguration.go | 81 ++++ .../util/backupconfigurationtemplate.go | 81 ++++ .../typed/stash/v1beta1/util/backupsession.go | 153 ++++++ .../typed/stash/v1beta1/util/function.go | 81 ++++ .../typed/stash/v1beta1/util/kubernetes.go | 32 ++ .../stash/v1beta1/util/restoresession.go | 152 ++++++ .../typed/stash/v1beta1/util/task.go | 81 ++++ .../stash/pkg/restic/backup.go | 241 ++++++++-- .../stash/pkg/restic/commands.go | 48 +- .../stash/pkg/restic/config.go | 27 ++ .../stash/pkg/restic/metrics.go | 269 ++++++----- .../stash/pkg/restic/output.go | 62 +-- .../stash/pkg/restic/restore.go | 205 +++++++- .../stash/pkg/restic/snapshot.go | 18 + .../stash.appscode.dev/stash/pkg/util/crds.go | 274 +++++++++++ .../stash/pkg/util/init_container.go | 18 +- .../stash.appscode.dev/stash/pkg/util/job.go | 189 +++++++- .../stash/pkg/util/kubernetes.go | 2 +- .../stash/pkg/util/restic.go | 6 +- .../stash/pkg/util/sidecar.go | 23 +- .../stash.appscode.dev/stash/pkg/util/util.go | 69 ++- 256 files changed, 10504 insertions(+), 2230 deletions(-) rename vendor/github.com/Azure/go-autorest/{ => autorest}/LICENSE (100%) create mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE create mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/go.mod create mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/go.sum create mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/LICENSE create mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/go.mod create mode 100644 vendor/github.com/Azure/go-autorest/autorest/go.mod create mode 100644 vendor/github.com/Azure/go-autorest/autorest/go.sum create mode 100644 vendor/github.com/Azure/go-autorest/logger/LICENSE create mode 100644 vendor/github.com/Azure/go-autorest/logger/go.mod create mode 100644 vendor/github.com/Azure/go-autorest/tracing/LICENSE create mode 100644 vendor/github.com/Azure/go-autorest/tracing/go.mod create mode 100644 vendor/github.com/Azure/go-autorest/tracing/go.sum delete mode 100644 vendor/github.com/appscode/jsonpatch/.gitignore delete mode 100644 vendor/github.com/appscode/jsonpatch/.travis.yml delete mode 100644 vendor/github.com/appscode/jsonpatch/README.md delete mode 100644 vendor/github.com/appscode/jsonpatch/go.mod delete mode 100644 vendor/github.com/appscode/jsonpatch/go.sum create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/build_info.go create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go create mode 100644 vendor/github.com/prometheus/procfs/net_unix.go rename vendor/{gopkg.in/robfig/cron.v2 => github.com/robfig/cron/v3}/.gitignore (100%) rename vendor/{gopkg.in/robfig/cron.v2 => github.com/robfig/cron/v3}/.travis.yml (100%) rename vendor/{gopkg.in/robfig/cron.v2 => github.com/robfig/cron/v3}/LICENSE (100%) create mode 100644 vendor/github.com/robfig/cron/v3/README.md create mode 100644 vendor/github.com/robfig/cron/v3/chain.go rename vendor/{gopkg.in/robfig/cron.v2 => github.com/robfig/cron/v3}/constantdelay.go (100%) create mode 100644 vendor/github.com/robfig/cron/v3/cron.go rename vendor/{gopkg.in/robfig/cron.v2 => github.com/robfig/cron/v3}/doc.go (51%) create mode 100644 vendor/github.com/robfig/cron/v3/go.mod create mode 100644 vendor/github.com/robfig/cron/v3/logger.go create mode 100644 vendor/github.com/robfig/cron/v3/option.go create mode 100644 vendor/github.com/robfig/cron/v3/parser.go rename vendor/{gopkg.in/robfig/cron.v2 => github.com/robfig/cron/v3}/spec.go (75%) create mode 100644 vendor/github.com/spf13/cobra/powershell_completions.go create mode 100644 vendor/github.com/spf13/cobra/powershell_completions.md create mode 100644 vendor/github.com/spf13/cobra/shell_completions.go create mode 100644 vendor/github.com/spf13/cobra/zsh_completions.md create mode 100644 vendor/golang.org/x/sys/unix/asm_linux_riscv64.s create mode 100644 vendor/golang.org/x/sys/unix/readdirent_getdents.go create mode 100644 vendor/golang.org/x/sys/unix/readdirent_getdirentries.go delete mode 100644 vendor/golang.org/x/sys/windows/mkerrors.go create mode 100644 vendor/golang.org/x/sys/windows/mkknownfolderids.bash create mode 100644 vendor/golang.org/x/sys/windows/zknownfolderids_windows.go rename vendor/{github.com/appscode/jsonpatch => gomodules.xyz/jsonpatch/v2}/LICENSE (100%) create mode 100644 vendor/gomodules.xyz/jsonpatch/v2/go.mod create mode 100644 vendor/gomodules.xyz/jsonpatch/v2/go.sum rename vendor/{github.com/appscode/jsonpatch => gomodules.xyz/jsonpatch/v2}/jsonpatch.go (97%) create mode 100644 vendor/google.golang.org/grpc/preloader.go delete mode 100644 vendor/gopkg.in/robfig/cron.v2/README.md delete mode 100644 vendor/gopkg.in/robfig/cron.v2/cron.go delete mode 100644 vendor/gopkg.in/robfig/cron.v2/parser.go create mode 100644 vendor/kmodules.xyz/offshoot-api/util/runtime_settings.go create mode 100644 vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go create mode 100644 vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfigurationtemplate.go create mode 100644 vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go create mode 100644 vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go create mode 100644 vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go create mode 100644 vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go create mode 100644 vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go create mode 100644 vendor/stash.appscode.dev/stash/pkg/util/crds.go diff --git a/go.mod b/go.mod index ae9488418..220cd0001 100644 --- a/go.mod +++ b/go.mod @@ -3,33 +3,24 @@ module stash.appscode.dev/postgres go 1.12 require ( - cloud.google.com/go v0.39.0 // indirect - github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8 + github.com/appscode/go v0.0.0-20190621064509-6b292c9166e3 github.com/gophercloud/gophercloud v0.0.0-20190520235722-e87e5f90e7e6 // indirect - github.com/prometheus/common v0.4.1 // indirect - github.com/prometheus/procfs v0.0.0-20190523193104-a7aeb8df3389 // indirect - github.com/spf13/cobra v0.0.4 - golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0 // indirect - google.golang.org/appengine v1.6.0 // indirect + github.com/spf13/cobra v0.0.5 k8s.io/api v0.0.0-20190515023547-db5a9d1c40eb // indirect - k8s.io/apiextensions-apiserver v0.0.0-20190515024537-2fd0e9006049 // indirect k8s.io/apimachinery v0.0.0-20190515023456-b74e4c97951f - k8s.io/cli-runtime v0.0.0-20190515024640-178667528169 // indirect k8s.io/client-go v11.0.0+incompatible k8s.io/klog v0.3.1 // indirect k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22 // indirect k8s.io/kubernetes v1.14.2 // indirect k8s.io/utils v0.0.0-20190520173318-324c5df7d3f0 // indirect - kmodules.xyz/client-go v0.0.0-20190518160232-4afdbc13ba68 + kmodules.xyz/client-go v0.0.0-20190715080709-7162a6c90b04 kmodules.xyz/custom-resources v0.0.0-20190508103408-464e8324c3ec - kmodules.xyz/objectstore-api v0.0.0-20190516233206-ea3ba546e348 // indirect - kmodules.xyz/webhook-runtime v0.0.0-20190508094945-962d01212c5b // indirect - stash.appscode.dev/stash v0.0.0-20190523192034-eadca45d8c6b + kmodules.xyz/objectstore-api v0.0.0-20190718002052-da668b440b0b // indirect + stash.appscode.dev/stash v0.0.0-20190718155146-3de534baa0a0 ) replace ( - github.com/graymeta/stow => github.com/appscode/stow v0.0.0-20190506085026-ca5baa008ea3 - gopkg.in/robfig/cron.v2 => github.com/appscode/cron v0.0.0-20170717094345-ca60c6d796d4 + github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.3.0+incompatible k8s.io/api => k8s.io/api v0.0.0-20190313235455-40a48860b5ab k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed k8s.io/apimachinery => github.com/kmodules/apimachinery v0.0.0-20190508045248-a52a97a7a2bf diff --git a/go.sum b/go.sum index 9ba39e379..6c10337c8 100644 --- a/go.sum +++ b/go.sum @@ -1,124 +1,137 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.27.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo= +cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.39.0 h1:UgQP9na6OTfp4dsAiz/eFpFA1C6tPdH5wiRdi19tuMw= cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= -contrib.go.opencensus.io/exporter/ocagent v0.5.0 h1:TKXjQSRS0/cCDrP7KvkgU6SmILtF/yV2TOs/02K/WZQ= -contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= -github.com/Azure/azure-sdk-for-go v14.6.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +cloud.google.com/go v0.41.0 h1:NFvqUTDnSNYPX5oReekmB+D+90jrJIcVImxQ3qrBVgM= +cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= +contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= +contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc= +contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= +contrib.go.opencensus.io/exporter/stackdriver v0.11.0/go.mod h1:hA7rlmtavV03FGxzWXAPBUnZeZBhWN/QYQAuMtxc9Bk= +contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= +contrib.go.opencensus.io/resource v0.0.0-20190131005048-21591786a5e0/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= +github.com/Azure/azure-amqp-common-go v1.1.3/go.mod h1:FhZtXirFANw40UXI2ntweO+VOkfaw8s6vZxUiRhLYW8= +github.com/Azure/azure-amqp-common-go v1.1.4/go.mod h1:FhZtXirFANw40UXI2ntweO+VOkfaw8s6vZxUiRhLYW8= +github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= +github.com/Azure/azure-pipeline-go v0.1.9/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= github.com/Azure/azure-sdk-for-go v21.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v29.0.0+incompatible h1:CYPU39ULbGjQBo3gXIqiWouK0C4F+Pt2Zx5CqGvqknE= -github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest v10.6.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v11.1.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v11.1.2+incompatible h1:viZ3tV5l4gE2Sw0xrasFHytCGtzYCrT+um/rrSQ1BfA= -github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v12.0.0+incompatible h1:N+VqClcomLGD/sHb3smbSYYtNMgKpVV3Cd5r5i8z6bQ= -github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/azure-sdk-for-go v27.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v31.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-service-bus-go v0.4.1/go.mod h1:d9ho9e/06euiTwGpKxmlbpPhFUsfCsq6a4tZ68r51qI= +github.com/Azure/azure-storage-blob-go v0.6.0/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= +github.com/Azure/go-autorest v12.3.0+incompatible h1:iw0EvmwwEhv8JzEFfbKNJjnrHJqiH5NlKqhdYiKXRUQ= +github.com/Azure/go-autorest v12.3.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.5.0 h1:Mlm9qy2fpQ9MvfyI41G2Zf5B4CsgjjNbLOWszfK6KrY= +github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw= +github.com/Azure/go-autorest/autorest/adal v0.2.0 h1:7IBDu1jgh+ADHXnEYExkV9RE/ztOOlxdACkkPRthGKw= +github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= +github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0 h1:Ww5g4zThfD/6cLb4z6xxgeyDa7QDkizMkJKe0ysZXp0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= +github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= +github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.1.0 h1:TRBxC5Pj/fIuh4Qob0ZpkggbfT8RC0SubHbpV3p4/Vc= +github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190418212003-6ac0b49e7197/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/appscode/cron v0.0.0-20170717094345-ca60c6d796d4 h1:QVmdGTg9tNzwiKDeHWCaUwPgwoJYBcgecR7NMQSDNP0= -github.com/appscode/cron v0.0.0-20170717094345-ca60c6d796d4/go.mod h1:cbZVORXl6mkgNKC3aHlaUBad4+yssRjqCnQKQgon6Sg= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0/go.mod h1:W9bsWfSbgJXUXzBZ+tSBV2g+zzT7ANPHQFsSXRHYKsA= github.com/appscode/go v0.0.0-20190424183524-60025f1135c9/go.mod h1:/PrESzUKHRrwhmBMpVXfGK3e/D0tqN+/dc8nSH03llU= -github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8 h1:OtKgsfyrDaDNv8ELfW8frpskwj+HqiLhT3trOLX+R9g= -github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8/go.mod h1:/PrESzUKHRrwhmBMpVXfGK3e/D0tqN+/dc8nSH03llU= -github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSepE2OqVu0Pn1CbDw9IuMlONapol0zuwk= +github.com/appscode/go v0.0.0-20190621064509-6b292c9166e3 h1:3V9/ZIWMUreWG6JTP34N2mii+gt2XCek7xPS66qKm90= +github.com/appscode/go v0.0.0-20190621064509-6b292c9166e3/go.mod h1:lZoPivA2BU6pxBzZ4KssqO69zfmCV5J4bscOFLIbCEA= github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= -github.com/appscode/osm v0.11.0 h1:I7fpsfJZVA+H7nXHuU0+JCUYEZdoN6p+7iyWjoFPTlE= -github.com/appscode/osm v0.11.0/go.mod h1:AWUXyF6Hl1LO0McvvZEYds3hgDdQ0tSIVm/PJq3eiao= -github.com/appscode/stow v0.0.0-20190506085026-ca5baa008ea3 h1:7k8Z87LszBRiaREKV6jW5eCLAO0KaR2agaXMRScqsS4= -github.com/appscode/stow v0.0.0-20190506085026-ca5baa008ea3/go.mod h1:34e6ldbiHdb1JjdDGoaBgggnC9hoIKDsXYFG/l4R9Nc= +github.com/appscode/osm v0.12.0/go.mod h1:M2dkG7yApVG4hWvRli6FgDxYItfkkN7jZditR2AAvdA= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aws/aws-sdk-go v1.12.7/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= github.com/aws/aws-sdk-go v1.14.12/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= -github.com/aws/aws-sdk-go v1.14.33/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.19.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= +github.com/aws/aws-sdk-go v1.18.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.19.16/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.20.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27 h1:HHUr4P/aKh4quafGxDT9LDasjGdlGkzLbfmmrlng3kA= github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE= -github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20190121005146-b04fd42d9952/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/distribution v0.0.0-20170726174610-edc3ab29cdff/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.0.0-20180612054059-a9fbbdc8dd87/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20150526203908-9cbd2a1374f4/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s= github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f h1:8GDPb0tCY8LQ+OJ3dbHb5sA6YZWXFORQYZx5sdsTlMs= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f h1:AUj1VoZUfhPhOPHULCQQDnGhRelpFWHMLhQVWDsS0v4= github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful v2.9.3+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flosch/pongo2 v0.0.0-20181225140029-79872a7b2769/go.mod h1:tbAXHifHQWNSpWbiJHpJTZH5fi3XHhDMdP//vuz9WS4= +github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-check/check v1.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-ini/ini v1.38.2/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-ini/ini v1.40.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 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-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.0 h1:FTUMcX77w5rQkClIzDtTxvn6Bsa894CcrzNj2MMfeg8= github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= @@ -130,8 +143,14 @@ github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsd github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.0 h1:Kg7Wl7LkTPlmc393QZQ/5rQadPhi7pBVEMZxyTi0Ii8= github.com/go-openapi/swag v0.19.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-xorm/builder v0.3.3/go.mod h1:v8mE3MFBgtL+RGFNfUnAMUqqfk/Y4W5KuwCFQIEpQLk= +github.com/go-xorm/core v0.6.2/go.mod h1:bwPIfLdm/FzWgVUH8WPVlr+uJhscvNGFcaZKXsI3n2c= +github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM= +github.com/go-xorm/xorm v0.7.3/go.mod h1:npNkX0GgFcODSSKHj7nhJPobHwa5E7usBBZUFaxCsXA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= @@ -140,9 +159,12 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9 github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/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 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -153,31 +175,33 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/readahead v0.0.0-20161222183148-eaceba169032/go.mod h1:qYysrqQXuV4tzsizt4oOQ6mrBZQ0xnQXP3ylXX8Jk5Y= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/wire v0.2.2/go.mod h1:7FHVg6mFpFQrjeUZrm+BaD50N5jnDKm50uVPTpyYOmU= +github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.0.0-20190504011306-6f9faf57fddc h1:uSlJNJjuqu+HrNGtCqIVjtMjrC0lzUjXZqfiUHxSzZc= github.com/gophercloud/gophercloud v0.0.0-20190504011306-6f9faf57fddc/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gophercloud/gophercloud v0.0.0-20190520235722-e87e5f90e7e6 h1:zgIL9er7ZX7e1ieUBMS+5avY5R2cO+ZuM6rWsZO3F5U= github.com/gophercloud/gophercloud v0.0.0-20190520235722-e87e5f90e7e6/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc h1:f8eY6cV/x1x+HLjOp4r72s/31/V2aTUtg5oKRRPf8/Q= github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.8.6 h1:XvND7+MPP7Jp+JpqSZ7naSl5nVZf6k0LbL1V3EKh0zc= @@ -194,17 +218,17 @@ github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= +github.com/jackc/pgx v3.3.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/go-ogle-analytics v0.0.0-20161213085824-14b04e0594ef h1:jLpa0vamfyIGeIJ/CfUJEWoKriw4ODeOgF1XxDvgMZ4= github.com/jpillora/go-ogle-analytics v0.0.0-20161213085824-14b04e0594ef/go.mod h1:PlwhC7q1VSK73InDzdDatVetQrTsQHIbOvcJAZzitY0= github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= @@ -216,10 +240,8 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kmodules/apimachinery v0.0.0-20190508045248-a52a97a7a2bf h1:XUigLZjjxvtR+TD7mncq0wUOaaG2H/zslqM42crk0SY= github.com/kmodules/apimachinery v0.0.0-20190508045248-a52a97a7a2bf/go.mod h1:1nbDY1cBTGna53FTjqnehJWker1BB75r+ElWRqNcYo8= -github.com/kmodules/apiserver v0.0.0-20190508082252-8397d761d4b5 h1:M10edLWmnwbcYIh3u6/E/K66a3BwMdY1IvqgHYxoKw0= github.com/kmodules/apiserver v0.0.0-20190508082252-8397d761d4b5/go.mod h1:rMEImsX8dFD0jGmDQXq3zbWddcIU8vlcrMWPzpXEm9g= 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 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= @@ -230,17 +252,19 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kubernetes-csi/external-snapshotter v1.1.0 h1:godlw8BSOac5TMGH2rVPJrmllek3y8wuqd9JsJHgulw= github.com/kubernetes-csi/external-snapshotter v1.1.0/go.mod h1:oYfxnsuh48V1UDYORl77YQxQbbdokNy7D73phuFpksY= github.com/kubernetes-incubator/service-catalog v0.1.43/go.mod h1:D0CRODiXUJs6VCZDB15TmCkesbuizkac9fYEiTA78BA= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 h1:wL11wNW7dhKIcRCHSm4sHKPWz0tt4mwBsVodG7+Xyqg= github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -252,26 +276,25 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30 h1:10VrZWOtDSvWhgViCi2J6VUp4p/B3pOA/efiMH3KjjI= github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/ncw/swift v1.0.41/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/ncw/swift v1.0.47 h1:4DQRPj35Y41WogBxyhOXlrI37nzGlyEcsforeudyYPQ= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -281,54 +304,47 @@ github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7/go.mod h1:YARuvh7BU github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3 h1:9iH4JKXLzFbOAdtqv/a+j8aewx2Y8lAjAydhbaScPF8= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_golang v0.9.4 h1:Y8E/JaaPbmFSW2V81Ab/d8yZFYQQGbni1b1jPcG9Y6A= +github.com/prometheus/client_golang v0.9.4/go.mod h1:oCXIBxdI62A4cR6aTRJCgetEjecSIYzOEaeAn4iYEpM= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.3.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190523193104-a7aeb8df3389 h1:F/k2nob1S9M6v5Xkq7KjSTQirOYaYQord0jR4TwyVmY= -github.com/prometheus/procfs v0.0.0-20190523193104-a7aeb8df3389/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/rancher/go-rancher v0.0.0-20160922212217-09693a8743ba/go.mod h1:7oQvGNiJsGvrUgB+7AH8bmdzuR0uhULfwKb43Ht0hUk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E= +github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190401211740-f487f9de1cd3/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.4 h1:S0tLZ3VOKl2Te0hpq8+ke0eSJPfCnNTPiDlsfwi1/NE= -github.com/spf13/cobra v0.0.4/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -338,10 +354,14 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= +github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= +github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v1.5.0/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yudai/gojsondiff v0.0.0-20180504020246-0525c875b75c h1:/8Xb/f8s2/ZZpzMzBkFwW2Jvj7Pglk+AW8m8FFqOoIQ= @@ -350,34 +370,44 @@ github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3Ifn github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= +github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg= +go.mongodb.org/mongo-driver v1.0.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= +go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +gocloud.dev v0.15.0/go.mod h1:ShXCyJaGrJu9y/7a6+DSCyBb9MFGZ1P5wwPa0Wu6w34= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190122013713-64072686203f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20170523201210-186fd3fc8194/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 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= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -385,16 +415,22 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190322120337-addf6b3196f6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 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-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= +golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0 h1:xFEXbcD0oa/xhqQmMXztdZ0bWvexAWds+8c1gRN8nu0= -golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 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= @@ -406,73 +442,90 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190508100423-12bbe5a7a520/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5 h1:sM3evRHxE/1RuMe1FYAL3j7C7fUfIjkbE+NiDAYUF8U= -golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/cert v1.0.0/go.mod h1:amhuI40SpnLj/4dWzsfZyVpblMsfKi0tYH83era8078= -gomodules.xyz/envsubst v0.0.0-20190321051520-c745d52104af h1:dvSifHtcUenMJOxj0sZs1lJ87ALY4jKvpfr3yTUK0OY= gomodules.xyz/envsubst v0.0.0-20190321051520-c745d52104af/go.mod h1:2o5f7bd13XIITbE2ZKieE05YkqB2KDoZkqKccGebduA= -gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3 h1:MiBtMikyjuBwD22+QIEsbnMHdRkknM/0N5ig34jSNgQ= +gomodules.xyz/jsonpatch/v2 v2.0.0 h1:OyHbl+7IOECpPKfVK42oFr6N7+Y2dR+Jsb/IiDV3hOo= +gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gomodules.xyz/stow v0.2.0/go.mod h1:nSTw1H1Gb/GktlrUgElN4YR+jww9OcNsxxrx3zNp+qA= gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.5.0 h1:lj9SyhMzyoa38fgFF0oO2T6pjs5IzkLPKfVtxpyCRMM= google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0 h1:9sdfJOzWlkqPltHAuzT2Cp+yrBeY1KRVYgms8soxMwM= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 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 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.0 h1:Tfd7cKwKbFRsI8RMAD3oqqw7JPFRrvFlOsfbgVkjOOw= -google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8 h1:x913Lq/RebkvUmRSdQ8MNb0GZKn+SR1ESfoetcQSeak= google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190626174449-989357319d63 h1:UsSJe9fhWNSz6emfIGPpH5DF23t7ALo2Pf3sC+/hsdg= +google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 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-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.38.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.40.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/kothar/go-backblaze.v0 v0.0.0-20180916190456-9ac0cf0dab1a/go.mod h1:zJ2QpyDCYo1KvLXlmdnFlQAyF/Qfth0fB8239Qg7BIE= +gopkg.in/kothar/go-backblaze.v0 v0.0.0-20190520213052-702d4e7eb465/go.mod h1:zJ2QpyDCYo1KvLXlmdnFlQAyF/Qfth0fB8239Qg7BIE= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -483,8 +536,10 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed h1:rCteec//ELIjZMfjIGQbVtZooyaofqDJwsmWwWKItNs= @@ -494,11 +549,9 @@ k8s.io/cli-runtime v0.0.0-20190314001948-2899ed30580f/go.mod h1:qWnH3/b8sp/l7Evl k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/cloud-provider v0.0.0-20190314002645-c892ea32361a/go.mod h1:LlIffnLBu+GG7d4ppPzC8UnA1Ex8S+ntmSRVsnr7Xy4= -k8s.io/component-base v0.0.0-20190314000054-4a91899592f4 h1:XOA0webBnNMJ6WOYQT1LzYtpEopiFgNzFI/L53B3ZsE= k8s.io/component-base v0.0.0-20190314000054-4a91899592f4/go.mod h1:DMaomcf3j3MM2j1FsvlLVVlc7wA2jPytEur3cP9zRxQ= k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/kube-aggregator v0.0.0-20190314000639-da8327669ac5 h1:LcJk/XH8WmmNigvMH4uPJUgpukqYVFXIYM9WSEyPqj4= k8s.io/kube-aggregator v0.0.0-20190314000639-da8327669ac5/go.mod h1:8sbzT4QQKDEmSCIbfqjV0sd97GpUT7A4W626sBiYJmU= k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI= k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= @@ -508,30 +561,27 @@ k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= kmodules.xyz/client-go v0.0.0-20190507204740-e4690d8026e7/go.mod h1:3meAILhyA9BTLbPQdVV2ucE4qaEjWy5dCb3S+L/1f4Y= kmodules.xyz/client-go v0.0.0-20190508091620-0d215c04352f/go.mod h1:R1t4K2wWb6PTkhQPEjqQIWz+gRS0/Z0mMfIy/TsdB/w= -kmodules.xyz/client-go v0.0.0-20190513064657-a9147783199a/go.mod h1:R1t4K2wWb6PTkhQPEjqQIWz+gRS0/Z0mMfIy/TsdB/w= -kmodules.xyz/client-go v0.0.0-20190518160232-4afdbc13ba68 h1:+7G6ENfzHymuUd3xEolFOVfk2yXU/ne5IEkvyjz5kXk= -kmodules.xyz/client-go v0.0.0-20190518160232-4afdbc13ba68/go.mod h1:R1t4K2wWb6PTkhQPEjqQIWz+gRS0/Z0mMfIy/TsdB/w= -kmodules.xyz/custom-resources v0.0.0-20190225012057-ed1c15a0bbda/go.mod h1:XSLXXzWk0aRybMX3PaR/4Kx938krmL5o3EaP1K7ltMg= +kmodules.xyz/client-go v0.0.0-20190715080709-7162a6c90b04 h1:17h0mshnlihkZMP6LqMmpliCQIknKasjdNGWyZCCmV4= +kmodules.xyz/client-go v0.0.0-20190715080709-7162a6c90b04/go.mod h1:3h1/ZglH6fV2uv3p9AB1JnHUknhWniShJ7fBJfSf7Js= kmodules.xyz/custom-resources v0.0.0-20190508103408-464e8324c3ec h1:a7sxsWe1QYUZaEWxGpSuzB6ZAdXmCwNh2SyMTLQKGEI= kmodules.xyz/custom-resources v0.0.0-20190508103408-464e8324c3ec/go.mod h1:0C61XSEPGexAmkrayynpNnCTacvkwn4802CRAQ5tUPI= -kmodules.xyz/objectstore-api v0.0.0-20190506085934-94c81c8acca9 h1:PlHk5XcNw2SqeSRKAyE9idW349HFN7G4c5j2n0ChhZY= -kmodules.xyz/objectstore-api v0.0.0-20190506085934-94c81c8acca9/go.mod h1:1HB+nnEbax/i2gAPFQRzL3pah1BpnVUcoTCzSgvP1Hw= -kmodules.xyz/objectstore-api v0.0.0-20190516233206-ea3ba546e348 h1:GViDM6wui0Em6gXNnFGqYriWSYroH4hqo7jgSg4a1MI= -kmodules.xyz/objectstore-api v0.0.0-20190516233206-ea3ba546e348/go.mod h1:90TB4uAMAFUHLSbxSl+uAgs/5GIdv5hSAJis4NhC8YU= -kmodules.xyz/offshoot-api v0.0.0-20190513045534-4f3df05f40c2 h1:l6F8uo3hoLW8OFarID65Zz5qtvVkekGrtgZICGfpUVw= -kmodules.xyz/offshoot-api v0.0.0-20190513045534-4f3df05f40c2/go.mod h1:x8mHwAqHV0QMkoZtp4rhlmxBswDsasxfaNOnKTJ52kI= +kmodules.xyz/objectstore-api v0.0.0-20190715131036-28ef070833ef/go.mod h1:SwUpd3z5BvdUks/Nh8Wtyp8US2ATxhxQmMathe4lyOM= +kmodules.xyz/objectstore-api v0.0.0-20190718002052-da668b440b0b h1:VRUyLLGvBjAezi9pQ89vGR+tcO+XROdJanGe2gPyGrY= +kmodules.xyz/objectstore-api v0.0.0-20190718002052-da668b440b0b/go.mod h1:SwUpd3z5BvdUks/Nh8Wtyp8US2ATxhxQmMathe4lyOM= +kmodules.xyz/offshoot-api v0.0.0-20190715115723-36c8fce142c1 h1:ak95Tpl+ur0n+18naC3FzNL01f6QmV9UR3zRF/SCFUs= +kmodules.xyz/offshoot-api v0.0.0-20190715115723-36c8fce142c1/go.mod h1:A6ALSeFH5Qm9fEkBu6hKfa4cV4ulDWqGo4rm3l00QnI= kmodules.xyz/openshift v0.0.0-20190225002038-ca9787d09794/go.mod h1:OA2SQV7Rn2+E553Xfp0uY5nwG0A9FztRiaWgP12Ubz8= kmodules.xyz/openshift v0.0.0-20190508141315-99ec9fc946bf h1:UyVK/KyL2O7XNV+1c7ZQL39HeIGdH79JlZTf/0E0Z/0= kmodules.xyz/openshift v0.0.0-20190508141315-99ec9fc946bf/go.mod h1:5l0No0OizfJ55sjDDpi0TgtGYWgmhy+F+i4+6DN61Ak= -kmodules.xyz/webhook-runtime v0.0.0-20190508093950-b721b4eba5e5 h1:40MH6o6EshW4z/8W2W5GEd56qzSpPrxVgpmZL+tsVPQ= -kmodules.xyz/webhook-runtime v0.0.0-20190508093950-b721b4eba5e5/go.mod h1:/8Kc9q3fttdmMwzxuQkiUJ1UNhvRbLDxNWwXgsaMUgU= -kmodules.xyz/webhook-runtime v0.0.0-20190508094945-962d01212c5b h1:DLS8I82vROQjh+GHW+dVtgzOWvq9+Kbzhx6HnECVQ1c= -kmodules.xyz/webhook-runtime v0.0.0-20190508094945-962d01212c5b/go.mod h1:/8Kc9q3fttdmMwzxuQkiUJ1UNhvRbLDxNWwXgsaMUgU= +kmodules.xyz/webhook-runtime v0.0.0-20190715115250-a84fbf77dd30 h1:laqTozueJ7IDWmKuS2ARiRbjbGt2U/tzd9opPFrhidU= +kmodules.xyz/webhook-runtime v0.0.0-20190715115250-a84fbf77dd30/go.mod h1:sojwlxXyjyHoF0arpK238DnHsecWij9VpWf50HtyBzE= +pack.ag/amqp v0.8.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= +pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= -sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2 h1:9r5DY45ef9LtcA6BnkhW8MPV7OKAfbf2AUwUhq3LeRk= sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -stash.appscode.dev/stash v0.0.0-20190523192034-eadca45d8c6b h1:l7gGdznILuI9dj2dNin7DTyQmtMChjT0sxDGgrv9M/I= -stash.appscode.dev/stash v0.0.0-20190523192034-eadca45d8c6b/go.mod h1:2re3paY51weqwgq5JHuZV1miwKUpQfouAP1YYGm1TYc= +stash.appscode.dev/stash v0.0.0-20190718155146-3de534baa0a0 h1:IfdPCuDR0Gv5MvpdjxUxA8sWOsrJNU7JPrPxmbDhLbQ= +stash.appscode.dev/stash v0.0.0-20190718155146-3de534baa0a0/go.mod h1:IZ1tG/VuTCKpxLVMKAd4OVJu6HJKSJXSW2ycWxJprCA= diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go index b08d663c4..3a9beda43 100644 --- a/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go +++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go @@ -18,27 +18,15 @@ import ( "math/rand" "sync/atomic" "time" - "unsafe" ) -func (ae *Exporter) lastConnectError() error { - errPtr := (*error)(atomic.LoadPointer(&ae.lastConnectErrPtr)) - if errPtr == nil { - return nil - } - return *errPtr -} - -func (ae *Exporter) saveLastConnectError(err error) { - var errPtr *error - if err != nil { - errPtr = &err - } - atomic.StorePointer(&ae.lastConnectErrPtr, unsafe.Pointer(errPtr)) -} +const ( + sDisconnected int32 = 5 + iota + sConnected +) -func (ae *Exporter) setStateDisconnected(err error) { - ae.saveLastConnectError(err) +func (ae *Exporter) setStateDisconnected() { + atomic.StoreInt32(&ae.connectionState, sDisconnected) select { case ae.disconnectedCh <- true: default: @@ -46,11 +34,11 @@ func (ae *Exporter) setStateDisconnected(err error) { } func (ae *Exporter) setStateConnected() { - ae.saveLastConnectError(nil) + atomic.StoreInt32(&ae.connectionState, sConnected) } func (ae *Exporter) connected() bool { - return ae.lastConnectError() == nil + return atomic.LoadInt32(&ae.connectionState) == sConnected } const defaultConnReattemptPeriod = 10 * time.Second @@ -89,18 +77,14 @@ func (ae *Exporter) indefiniteBackgroundConnection() error { if err := ae.connect(); err == nil { ae.setStateConnected() } else { - ae.setStateDisconnected(err) + ae.setStateDisconnected() } // Apply some jitter to avoid lockstep retrials of other // agent-exporters. Lockstep retrials could result in an // innocent DDOS, by clogging the machine's resources and network. jitter := time.Duration(rng.Int63n(maxJitter)) - select { - case <-ae.stopCh: - return errStopped - case <-time.After(connReattemptPeriod + jitter): - } + <-time.After(connReattemptPeriod + jitter) } } diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod index 00db1613b..72a9068e4 100644 --- a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod +++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.mod @@ -4,7 +4,7 @@ require ( github.com/census-instrumentation/opencensus-proto v0.2.0 // this is to match the version used in census-instrumentation/opencensus-service github.com/golang/protobuf v1.3.1 github.com/grpc-ecosystem/grpc-gateway v1.8.5 // indirect - go.opencensus.io v0.21.0 - google.golang.org/api v0.4.0 - google.golang.org/grpc v1.20.1 + go.opencensus.io v0.20.2 + google.golang.org/api v0.3.1 + google.golang.org/grpc v1.19.1 ) diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum index c4faa0c27..52c362aaa 100644 --- a/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum +++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/go.sum @@ -1,10 +1,26 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -12,28 +28,60 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/grpc-ecosystem/grpc-gateway v1.8.5 h1:2+KSC78XiO6Qy0hIjfc1OD9H+hsaJdJlb8Kqsd41CTE= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 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/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 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= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -46,26 +94,37 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -google.golang.org/api v0.4.0 h1:KKgc1aqhV8wDPbDzlDtpvyjZFY3vjz85FP7p4wcQUyI= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go index b3a1388d0..510da99ea 100644 --- a/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go +++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go @@ -18,10 +18,8 @@ import ( "context" "errors" "fmt" - "io" "sync" "time" - "unsafe" "google.golang.org/api/support/bundler" "google.golang.org/grpc" @@ -54,12 +52,12 @@ var _ trace.Exporter = (*Exporter)(nil) var _ view.Exporter = (*Exporter)(nil) type Exporter struct { + connectionState int32 + // mu protects the non-atomic and non-channel variables mu sync.RWMutex - // senderMu protects the concurrent unsafe send on traceExporter client - senderMu sync.Mutex - // recvMu protects the concurrent unsafe recv on traceExporter client - recvMu sync.Mutex + // senderMu protects the concurrent unsafe traceExporter client + senderMu sync.RWMutex started bool stopped bool agentAddress string @@ -73,7 +71,6 @@ type Exporter struct { resource *resourcepb.Resource compressor string headers map[string]string - lastConnectErrPtr unsafe.Pointer startOnce sync.Once stopCh chan bool @@ -89,8 +86,6 @@ type Exporter struct { viewDataBundler *bundler.Bundler clientTransportCredentials credentials.TransportCredentials - - grpcDialOptions []grpc.DialOption } func NewExporter(opts ...ExporterOption) (*Exporter, error) { @@ -139,6 +134,7 @@ var ( errAlreadyStarted = errors.New("already started") errNotStarted = errors.New("not started") errStopped = errors.New("stopped") + errNoConnection = errors.New("no active connection") ) // Start dials to the agent, establishing a connection to it. It also @@ -150,20 +146,14 @@ func (ae *Exporter) Start() error { var err = errAlreadyStarted ae.startOnce.Do(func() { ae.mu.Lock() + defer ae.mu.Unlock() + ae.started = true ae.disconnectedCh = make(chan bool, 1) ae.stopCh = make(chan bool) ae.backgroundConnectionDoneCh = make(chan bool) - ae.mu.Unlock() - - // An optimistic first connection attempt to ensure that - // applications under heavy load can immediately process - // data. See https://github.com/census-ecosystem/opencensus-go-exporter-ocagent/pull/63 - if err := ae.connect(); err == nil { - ae.setStateConnected() - } else { - ae.setStateDisconnected(err) - } + + ae.setStateDisconnected() go ae.indefiniteBackgroundConnection() err = nil @@ -280,9 +270,6 @@ func (ae *Exporter) dialToAgent() (*grpc.ClientConn, error) { dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(grpc.UseCompressor(ae.compressor))) } dialOpts = append(dialOpts, grpc.WithStatsHandler(&ocgrpc.ClientHandler{})) - if len(ae.grpcDialOptions) != 0 { - dialOpts = append(dialOpts, ae.grpcDialOptions...) - } ctx := context.Background() if len(ae.headers) > 0 { @@ -381,33 +368,16 @@ func (ae *Exporter) ExportTraceServiceRequest(batch *agenttracepb.ExportTraceSer return errStopped default: - if lastConnectErr := ae.lastConnectError(); lastConnectErr != nil { - return fmt.Errorf("ExportTraceServiceRequest: no active connection, last connection error: %v", lastConnectErr) + if !ae.connected() { + return errNoConnection } ae.senderMu.Lock() err := ae.traceExporter.Send(batch) ae.senderMu.Unlock() if err != nil { - if err == io.EOF { - ae.recvMu.Lock() - // Perform a .Recv to try to find out why the RPC actually ended. - // See: - // * https://github.com/grpc/grpc-go/blob/d389f9fac68eea0dcc49957d0b4cca5b3a0a7171/stream.go#L98-L100 - // * https://groups.google.com/forum/#!msg/grpc-io/XcN4hA9HonI/F_UDiejTAwAJ - for { - _, err = ae.traceExporter.Recv() - if err != nil { - break - } - } - ae.recvMu.Unlock() - } - - ae.setStateDisconnected(err) - if err != io.EOF { - return err - } + ae.setStateDisconnected() + return err } return nil } @@ -453,7 +423,7 @@ func (ae *Exporter) uploadTraces(sdl []*trace.SpanData) { }) ae.senderMu.Unlock() if err != nil { - ae.setStateDisconnected(err) + ae.setStateDisconnected() } } } @@ -497,7 +467,7 @@ func (ae *Exporter) uploadViewData(vdl []*view.Data) { // or better letting users of the exporter configure it. }) if err != nil { - ae.setStateDisconnected(err) + ae.setStateDisconnected() } } } diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go index edeae65e1..3e05ae8b3 100644 --- a/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go +++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go @@ -17,7 +17,6 @@ package ocagent import ( "time" - "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) @@ -127,18 +126,3 @@ func WithTLSCredentials(creds credentials.TransportCredentials) ExporterOption { func (cc *clientCredentials) withExporter(e *Exporter) { e.clientTransportCredentials = cc.TransportCredentials } - -type grpcDialOptions []grpc.DialOption - -var _ ExporterOption = (*grpcDialOptions)(nil) - -// WithGRPCDialOption opens support to any grpc.DialOption to be used. If it conflicts -// with some other configuration the GRPC specified via the agent the ones here will -// take preference since they are set last. -func WithGRPCDialOption(opts ...grpc.DialOption) ExporterOption { - return grpcDialOptions(opts) -} - -func (opts grpcDialOptions) withExporter(e *Exporter) { - e.grpcDialOptions = opts -} diff --git a/vendor/github.com/Azure/go-autorest/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/LICENSE similarity index 100% rename from vendor/github.com/Azure/go-autorest/LICENSE rename to vendor/github.com/Azure/go-autorest/autorest/LICENSE diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE new file mode 100644 index 000000000..b9d6a27ea --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE @@ -0,0 +1,191 @@ + + 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 + + Copyright 2015 Microsoft Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go index 8c83a917f..fa5964742 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go @@ -15,10 +15,15 @@ package adal // limitations under the License. import ( + "errors" "fmt" "net/url" ) +const ( + activeDirectoryEndpointTemplate = "%s/oauth2/%s%s" +) + // OAuthConfig represents the endpoints needed // in OAuth operations type OAuthConfig struct { @@ -60,7 +65,6 @@ func NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID string, apiV } api = fmt.Sprintf("?api-version=%s", *apiVersion) } - const activeDirectoryEndpointTemplate = "%s/oauth2/%s%s" u, err := url.Parse(activeDirectoryEndpoint) if err != nil { return nil, err @@ -89,3 +93,59 @@ func NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID string, apiV DeviceCodeEndpoint: *deviceCodeURL, }, nil } + +// MultiTenantOAuthConfig provides endpoints for primary and aulixiary tenant IDs. +type MultiTenantOAuthConfig interface { + PrimaryTenant() *OAuthConfig + AuxiliaryTenants() []*OAuthConfig +} + +// OAuthOptions contains optional OAuthConfig creation arguments. +type OAuthOptions struct { + APIVersion string +} + +func (c OAuthOptions) apiVersion() string { + if c.APIVersion != "" { + return fmt.Sprintf("?api-version=%s", c.APIVersion) + } + return "1.0" +} + +// NewMultiTenantOAuthConfig creates an object that support multitenant OAuth configuration. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/authenticate-multi-tenant for more information. +func NewMultiTenantOAuthConfig(activeDirectoryEndpoint, primaryTenantID string, auxiliaryTenantIDs []string, options OAuthOptions) (MultiTenantOAuthConfig, error) { + if len(auxiliaryTenantIDs) == 0 || len(auxiliaryTenantIDs) > 3 { + return nil, errors.New("must specify one to three auxiliary tenants") + } + mtCfg := multiTenantOAuthConfig{ + cfgs: make([]*OAuthConfig, len(auxiliaryTenantIDs)+1), + } + apiVer := options.apiVersion() + pri, err := NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, primaryTenantID, &apiVer) + if err != nil { + return nil, fmt.Errorf("failed to create OAuthConfig for primary tenant: %v", err) + } + mtCfg.cfgs[0] = pri + for i := range auxiliaryTenantIDs { + aux, err := NewOAuthConfig(activeDirectoryEndpoint, auxiliaryTenantIDs[i]) + if err != nil { + return nil, fmt.Errorf("failed to create OAuthConfig for tenant '%s': %v", auxiliaryTenantIDs[i], err) + } + mtCfg.cfgs[i+1] = aux + } + return mtCfg, nil +} + +type multiTenantOAuthConfig struct { + // first config in the slice is the primary tenant + cfgs []*OAuthConfig +} + +func (m multiTenantOAuthConfig) PrimaryTenant() *OAuthConfig { + return m.cfgs[0] +} + +func (m multiTenantOAuthConfig) AuxiliaryTenants() []*OAuthConfig { + return m.cfgs[1:] +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/go.mod b/vendor/github.com/Azure/go-autorest/autorest/adal/go.mod new file mode 100644 index 000000000..5c95dbfea --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/go.mod @@ -0,0 +1,11 @@ +module github.com/Azure/go-autorest/autorest/adal + +go 1.12 + +require ( + github.com/Azure/go-autorest/autorest/date v0.1.0 + github.com/Azure/go-autorest/autorest/mocks v0.1.0 + github.com/Azure/go-autorest/tracing v0.1.0 + github.com/dgrijalva/jwt-go v3.2.0+incompatible + golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 +) diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/go.sum b/vendor/github.com/Azure/go-autorest/autorest/adal/go.sum new file mode 100644 index 000000000..ef9d10161 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/go.sum @@ -0,0 +1,139 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc= +contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= +github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0 h1:Kx+AUU2Te+A3JIyYn6Dfs+cFgx5XorQKuIXrZGoq/SI= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/tracing v0.1.0 h1:TRBxC5Pj/fIuh4Qob0ZpkggbfT8RC0SubHbpV3p4/Vc= +github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4= +github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/grpc-ecosystem/grpc-gateway v1.8.5 h1:2+KSC78XiO6Qy0hIjfc1OD9H+hsaJdJlb8Kqsd41CTE= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +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/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +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= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +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/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index effa87ab2..4083e76e6 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -71,6 +71,12 @@ type OAuthTokenProvider interface { OAuthToken() string } +// MultitenantOAuthTokenProvider provides tokens used for multi-tenant authorization. +type MultitenantOAuthTokenProvider interface { + PrimaryOAuthToken() string + AuxiliaryOAuthTokens() []string +} + // TokenRefreshError is an interface used by errors returned during token refresh. type TokenRefreshError interface { error @@ -983,3 +989,67 @@ func (spt *ServicePrincipalToken) Token() Token { defer spt.refreshLock.RUnlock() return spt.inner.Token } + +// MultiTenantServicePrincipalToken contains tokens for multi-tenant authorization. +type MultiTenantServicePrincipalToken struct { + PrimaryToken *ServicePrincipalToken + AuxiliaryTokens []*ServicePrincipalToken +} + +// PrimaryOAuthToken returns the primary authorization token. +func (mt *MultiTenantServicePrincipalToken) PrimaryOAuthToken() string { + return mt.PrimaryToken.OAuthToken() +} + +// AuxiliaryOAuthTokens returns one to three auxiliary authorization tokens. +func (mt *MultiTenantServicePrincipalToken) AuxiliaryOAuthTokens() []string { + tokens := make([]string, len(mt.AuxiliaryTokens)) + for i := range mt.AuxiliaryTokens { + tokens[i] = mt.AuxiliaryTokens[i].OAuthToken() + } + return tokens +} + +// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by +// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. +func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { + if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil { + return fmt.Errorf("failed to refresh primary token: %v", err) + } + for _, aux := range mt.AuxiliaryTokens { + if err := aux.EnsureFreshWithContext(ctx); err != nil { + return fmt.Errorf("failed to refresh auxiliary token: %v", err) + } + } + return nil +} + +// NewMultiTenantServicePrincipalToken creates a new MultiTenantServicePrincipalToken with the specified credentials and resource. +func NewMultiTenantServicePrincipalToken(multiTenantCfg MultiTenantOAuthConfig, clientID string, secret string, resource string) (*MultiTenantServicePrincipalToken, error) { + if err := validateStringParam(clientID, "clientID"); err != nil { + return nil, err + } + if err := validateStringParam(secret, "secret"); err != nil { + return nil, err + } + if err := validateStringParam(resource, "resource"); err != nil { + return nil, err + } + auxTenants := multiTenantCfg.AuxiliaryTenants() + m := MultiTenantServicePrincipalToken{ + AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)), + } + primary, err := NewServicePrincipalToken(*multiTenantCfg.PrimaryTenant(), clientID, secret, resource) + if err != nil { + return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err) + } + m.PrimaryToken = primary + for i := range auxTenants { + aux, err := NewServicePrincipalToken(*auxTenants[i], clientID, secret, resource) + if err != nil { + return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err) + } + m.AuxiliaryTokens[i] = aux + } + return &m, nil +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go index 2e24b4b39..380865cd6 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go +++ b/vendor/github.com/Azure/go-autorest/autorest/authorization.go @@ -285,3 +285,52 @@ func (ba *BasicAuthorizer) WithAuthorization() PrepareDecorator { return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization() } + +// MultiTenantServicePrincipalTokenAuthorizer provides authentication across tenants. +type MultiTenantServicePrincipalTokenAuthorizer interface { + WithAuthorization() PrepareDecorator +} + +// NewMultiTenantServicePrincipalTokenAuthorizer crates a BearerAuthorizer using the given token provider +func NewMultiTenantServicePrincipalTokenAuthorizer(tp adal.MultitenantOAuthTokenProvider) MultiTenantServicePrincipalTokenAuthorizer { + return &multiTenantSPTAuthorizer{tp: tp} +} + +type multiTenantSPTAuthorizer struct { + tp adal.MultitenantOAuthTokenProvider +} + +// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header using the +// primary token along with the auxiliary authorization header using the auxiliary tokens. +// +// By default, the token will be automatically refreshed through the Refresher interface. +func (mt multiTenantSPTAuthorizer) WithAuthorization() PrepareDecorator { + return func(p Preparer) Preparer { + return PreparerFunc(func(r *http.Request) (*http.Request, error) { + r, err := p.Prepare(r) + if err != nil { + return r, err + } + if refresher, ok := mt.tp.(adal.RefresherWithContext); ok { + err = refresher.EnsureFreshWithContext(r.Context()) + if err != nil { + var resp *http.Response + if tokError, ok := err.(adal.TokenRefreshError); ok { + resp = tokError.Response() + } + return r, NewErrorWithError(err, "azure.multiTenantSPTAuthorizer", "WithAuthorization", resp, + "Failed to refresh one or more Tokens for request to %s", r.URL) + } + } + r, err = Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", mt.tp.PrimaryOAuthToken()))) + if err != nil { + return r, err + } + auxTokens := mt.tp.AuxiliaryOAuthTokens() + for i := range auxTokens { + auxTokens[i] = fmt.Sprintf("Bearer %s", auxTokens[i]) + } + return Prepare(r, WithHeader(headerAuxAuthorization, strings.Join(auxTokens, "; "))) + }) + } +} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go index cdde41418..6c20b8179 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go @@ -45,6 +45,7 @@ type ResourceIdentifier struct { Datalake string `json:"datalake"` Batch string `json:"batch"` OperationalInsights string `json:"operationalInsights"` + Storage string `json:"storage"` } // Environment represents a set of endpoints for each of Azure's Clouds. @@ -103,6 +104,7 @@ var ( Datalake: "https://datalake.azure.net/", Batch: "https://batch.core.windows.net/", OperationalInsights: "https://api.loganalytics.io", + Storage: "https://storage.azure.com/", }, } @@ -135,6 +137,7 @@ var ( Datalake: NotAvailable, Batch: "https://batch.core.usgovcloudapi.net/", OperationalInsights: "https://api.loganalytics.us", + Storage: "https://storage.azure.com/", }, } @@ -167,6 +170,7 @@ var ( Datalake: NotAvailable, Batch: "https://batch.chinacloudapi.cn/", OperationalInsights: NotAvailable, + Storage: "https://storage.azure.com/", }, } @@ -199,6 +203,7 @@ var ( Datalake: NotAvailable, Batch: "https://batch.cloudapi.de/", OperationalInsights: NotAvailable, + Storage: "https://storage.azure.com/", }, } ) diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go index cfc7ed757..92da6adb2 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/client.go +++ b/vendor/github.com/Azure/go-autorest/autorest/client.go @@ -73,6 +73,22 @@ type Response struct { *http.Response `json:"-"` } +// IsHTTPStatus returns true if the returned HTTP status code matches the provided status code. +// If there was no response (i.e. the underlying http.Response is nil) the return value is false. +func (r Response) IsHTTPStatus(statusCode int) bool { + if r.Response == nil { + return false + } + return r.Response.StatusCode == statusCode +} + +// HasHTTPStatus returns true if the returned HTTP status code matches one of the provided status codes. +// If there was no response (i.e. the underlying http.Response is nil) or not status codes are provided +// the return value is false. +func (r Response) HasHTTPStatus(statusCodes ...int) bool { + return ResponseHasStatusCode(r.Response, statusCodes...) +} + // LoggingInspector implements request and response inspectors that log the full request and // response to a supplied log. type LoggingInspector struct { diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE new file mode 100644 index 000000000..b9d6a27ea --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE @@ -0,0 +1,191 @@ + + 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 + + Copyright 2015 Microsoft Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/go.mod b/vendor/github.com/Azure/go-autorest/autorest/date/go.mod new file mode 100644 index 000000000..13a1e9803 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/date/go.mod @@ -0,0 +1,3 @@ +module github.com/Azure/go-autorest/autorest/date + +go 1.12 diff --git a/vendor/github.com/Azure/go-autorest/autorest/go.mod b/vendor/github.com/Azure/go-autorest/autorest/go.mod new file mode 100644 index 000000000..6b7c7f276 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/go.mod @@ -0,0 +1,12 @@ +module github.com/Azure/go-autorest/autorest + +go 1.12 + +require ( + github.com/Azure/go-autorest/autorest/adal v0.2.0 + github.com/Azure/go-autorest/autorest/mocks v0.1.0 + github.com/Azure/go-autorest/logger v0.1.0 + github.com/Azure/go-autorest/tracing v0.1.0 + go.opencensus.io v0.20.2 + golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 +) diff --git a/vendor/github.com/Azure/go-autorest/autorest/go.sum b/vendor/github.com/Azure/go-autorest/autorest/go.sum new file mode 100644 index 000000000..a6848303f --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/autorest/go.sum @@ -0,0 +1,143 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc= +contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= +github.com/Azure/go-autorest/autorest/adal v0.2.0 h1:7IBDu1jgh+ADHXnEYExkV9RE/ztOOlxdACkkPRthGKw= +github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= +github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0 h1:Kx+AUU2Te+A3JIyYn6Dfs+cFgx5XorQKuIXrZGoq/SI= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.1.0 h1:TRBxC5Pj/fIuh4Qob0ZpkggbfT8RC0SubHbpV3p4/Vc= +github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4= +github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/grpc-ecosystem/grpc-gateway v1.8.5 h1:2+KSC78XiO6Qy0hIjfc1OD9H+hsaJdJlb8Kqsd41CTE= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +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/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +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= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +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/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/github.com/Azure/go-autorest/autorest/preparer.go b/vendor/github.com/Azure/go-autorest/autorest/preparer.go index 6d67bd733..489140224 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/preparer.go +++ b/vendor/github.com/Azure/go-autorest/autorest/preparer.go @@ -17,6 +17,7 @@ package autorest import ( "bytes" "encoding/json" + "encoding/xml" "fmt" "io" "io/ioutil" @@ -31,9 +32,10 @@ const ( mimeTypeOctetStream = "application/octet-stream" mimeTypeFormPost = "application/x-www-form-urlencoded" - headerAuthorization = "Authorization" - headerContentType = "Content-Type" - headerUserAgent = "User-Agent" + headerAuthorization = "Authorization" + headerAuxAuthorization = "x-ms-authorization-auxiliary" + headerContentType = "Content-Type" + headerUserAgent = "User-Agent" ) // Preparer is the interface that wraps the Prepare method. @@ -190,6 +192,9 @@ func AsGet() PrepareDecorator { return WithMethod("GET") } // AsHead returns a PrepareDecorator that sets the HTTP method to HEAD. func AsHead() PrepareDecorator { return WithMethod("HEAD") } +// AsMerge returns a PrepareDecorator that sets the HTTP method to MERGE. +func AsMerge() PrepareDecorator { return WithMethod("MERGE") } + // AsOptions returns a PrepareDecorator that sets the HTTP method to OPTIONS. func AsOptions() PrepareDecorator { return WithMethod("OPTIONS") } @@ -225,6 +230,25 @@ func WithBaseURL(baseURL string) PrepareDecorator { } } +// WithBytes returns a PrepareDecorator that takes a list of bytes +// which passes the bytes directly to the body +func WithBytes(input *[]byte) PrepareDecorator { + return func(p Preparer) Preparer { + return PreparerFunc(func(r *http.Request) (*http.Request, error) { + r, err := p.Prepare(r) + if err == nil { + if input == nil { + return r, fmt.Errorf("Input Bytes was nil") + } + + r.ContentLength = int64(len(*input)) + r.Body = ioutil.NopCloser(bytes.NewReader(*input)) + } + return r, err + }) + } +} + // WithCustomBaseURL returns a PrepareDecorator that replaces brace-enclosed keys within the // request base URL (i.e., http.Request.URL) with the corresponding values from the passed map. func WithCustomBaseURL(baseURL string, urlParameters map[string]interface{}) PrepareDecorator { @@ -377,6 +401,28 @@ func WithJSON(v interface{}) PrepareDecorator { } } +// WithXML returns a PrepareDecorator that encodes the data passed as XML into the body of the +// request and sets the Content-Length header. +func WithXML(v interface{}) PrepareDecorator { + return func(p Preparer) Preparer { + return PreparerFunc(func(r *http.Request) (*http.Request, error) { + r, err := p.Prepare(r) + if err == nil { + b, err := xml.Marshal(v) + if err == nil { + // we have to tack on an XML header + withHeader := xml.Header + string(b) + bytesWithHeader := []byte(withHeader) + + r.ContentLength = int64(len(bytesWithHeader)) + r.Body = ioutil.NopCloser(bytes.NewReader(bytesWithHeader)) + } + } + return r, err + }) + } +} + // WithPath returns a PrepareDecorator that adds the supplied path to the request URL. If the path // is absolute (that is, it begins with a "/"), it replaces the existing path. func WithPath(path string) PrepareDecorator { diff --git a/vendor/github.com/Azure/go-autorest/autorest/responder.go b/vendor/github.com/Azure/go-autorest/autorest/responder.go index a908a0adb..349e1963a 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/responder.go +++ b/vendor/github.com/Azure/go-autorest/autorest/responder.go @@ -153,6 +153,25 @@ func ByClosingIfError() RespondDecorator { } } +// ByUnmarshallingBytes returns a RespondDecorator that copies the Bytes returned in the +// response Body into the value pointed to by v. +func ByUnmarshallingBytes(v *[]byte) RespondDecorator { + return func(r Responder) Responder { + return ResponderFunc(func(resp *http.Response) error { + err := r.Respond(resp) + if err == nil { + bytes, errInner := ioutil.ReadAll(resp.Body) + if errInner != nil { + err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner) + } else { + *v = bytes + } + } + return err + }) + } +} + // ByUnmarshallingJSON returns a RespondDecorator that decodes a JSON document returned in the // response Body into the value pointed to by v. func ByUnmarshallingJSON(v interface{}) RespondDecorator { diff --git a/vendor/github.com/Azure/go-autorest/autorest/sender.go b/vendor/github.com/Azure/go-autorest/autorest/sender.go index 6665d7c00..b918833fa 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/sender.go +++ b/vendor/github.com/Azure/go-autorest/autorest/sender.go @@ -15,6 +15,7 @@ package autorest // limitations under the License. import ( + "context" "fmt" "log" "math" @@ -25,6 +26,23 @@ import ( "github.com/Azure/go-autorest/tracing" ) +// used as a key type in context.WithValue() +type ctxSendDecorators struct{} + +// WithSendDecorators adds the specified SendDecorators to the provided context. +func WithSendDecorators(ctx context.Context, sendDecorator []SendDecorator) context.Context { + return context.WithValue(ctx, ctxSendDecorators{}, sendDecorator) +} + +// GetSendDecorators returns the SendDecorators in the provided context or the provided default SendDecorators. +func GetSendDecorators(ctx context.Context, defaultSendDecorators ...SendDecorator) []SendDecorator { + inCtx := ctx.Value(ctxSendDecorators{}) + if sd, ok := inCtx.([]SendDecorator); ok { + return sd + } + return defaultSendDecorators +} + // Sender is the interface that wraps the Do method to send HTTP requests. // // The standard http.Client conforms to this interface. @@ -211,53 +229,77 @@ func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator { // DoRetryForStatusCodes returns a SendDecorator that retries for specified statusCodes for up to the specified // number of attempts, exponentially backing off between requests using the supplied backoff -// time.Duration (which may be zero). Retrying may be canceled by closing the optional channel on -// the http.Request. +// time.Duration (which may be zero). Retrying may be canceled by cancelling the context on the http.Request. +// NOTE: Code http.StatusTooManyRequests (429) will *not* be counted against the number of attempts. func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) SendDecorator { return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := NewRetriableRequest(r) - // Increment to add the first call (attempts denotes number of retries) - for attempt := 0; attempt < attempts+1; { - err = rr.Prepare() - if err != nil { - return resp, err - } - resp, err = s.Do(rr.Request()) - // if the error isn't temporary don't bother retrying - if err != nil && !IsTemporaryNetworkError(err) { - return nil, err - } - // we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication - // resp and err will both have a value, so in this case we don't want to retry as it will never succeed. - if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) { - return resp, err - } - delayed := DelayWithRetryAfter(resp, r.Context().Done()) - if !delayed && !DelayForBackoff(backoff, attempt, r.Context().Done()) { - return resp, r.Context().Err() - } - // don't count a 429 against the number of attempts - // so that we continue to retry until it succeeds - if resp == nil || resp.StatusCode != http.StatusTooManyRequests { - attempt++ - } - } - return resp, err + return SenderFunc(func(r *http.Request) (*http.Response, error) { + return doRetryForStatusCodesImpl(s, r, false, attempts, backoff, 0, codes...) }) } } -// DelayWithRetryAfter invokes time.After for the duration specified in the "Retry-After" header in -// responses with status code 429 +// DoRetryForStatusCodesWithCap returns a SendDecorator that retries for specified statusCodes for up to the +// specified number of attempts, exponentially backing off between requests using the supplied backoff +// time.Duration (which may be zero). To cap the maximum possible delay between iterations specify a value greater +// than zero for cap. Retrying may be canceled by cancelling the context on the http.Request. +func DoRetryForStatusCodesWithCap(attempts int, backoff, cap time.Duration, codes ...int) SendDecorator { + return func(s Sender) Sender { + return SenderFunc(func(r *http.Request) (*http.Response, error) { + return doRetryForStatusCodesImpl(s, r, true, attempts, backoff, cap, codes...) + }) + } +} + +func doRetryForStatusCodesImpl(s Sender, r *http.Request, count429 bool, attempts int, backoff, cap time.Duration, codes ...int) (resp *http.Response, err error) { + rr := NewRetriableRequest(r) + // Increment to add the first call (attempts denotes number of retries) + for attempt := 0; attempt < attempts+1; { + err = rr.Prepare() + if err != nil { + return + } + resp, err = s.Do(rr.Request()) + // if the error isn't temporary don't bother retrying + if err != nil && !IsTemporaryNetworkError(err) { + return + } + // we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication + // resp and err will both have a value, so in this case we don't want to retry as it will never succeed. + if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) { + return resp, err + } + delayed := DelayWithRetryAfter(resp, r.Context().Done()) + if !delayed && !DelayForBackoffWithCap(backoff, cap, attempt, r.Context().Done()) { + return resp, r.Context().Err() + } + // when count429 == false don't count a 429 against the number + // of attempts so that we continue to retry until it succeeds + if count429 || (resp == nil || resp.StatusCode != http.StatusTooManyRequests) { + attempt++ + } + } + return resp, err +} + +// DelayWithRetryAfter invokes time.After for the duration specified in the "Retry-After" header. +// The value of Retry-After can be either the number of seconds or a date in RFC1123 format. +// The function returns true after successfully waiting for the specified duration. If there is +// no Retry-After header or the wait is cancelled the return value is false. func DelayWithRetryAfter(resp *http.Response, cancel <-chan struct{}) bool { if resp == nil { return false } - retryAfter, _ := strconv.Atoi(resp.Header.Get("Retry-After")) - if resp.StatusCode == http.StatusTooManyRequests && retryAfter > 0 { + var dur time.Duration + ra := resp.Header.Get("Retry-After") + if retryAfter, _ := strconv.Atoi(ra); retryAfter > 0 { + dur = time.Duration(retryAfter) * time.Second + } else if t, err := time.Parse(time.RFC1123, ra); err == nil { + dur = t.Sub(time.Now()) + } + if dur > 0 { select { - case <-time.After(time.Duration(retryAfter) * time.Second): + case <-time.After(dur): return true case <-cancel: return false @@ -317,8 +359,22 @@ func WithLogging(logger *log.Logger) SendDecorator { // Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt // count. func DelayForBackoff(backoff time.Duration, attempt int, cancel <-chan struct{}) bool { + return DelayForBackoffWithCap(backoff, 0, attempt, cancel) +} + +// DelayForBackoffWithCap invokes time.After for the supplied backoff duration raised to the power of +// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set +// to zero for no delay. To cap the maximum possible delay specify a value greater than zero for cap. +// The delay may be canceled by closing the passed channel. If terminated early, returns false. +// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt +// count. +func DelayForBackoffWithCap(backoff, cap time.Duration, attempt int, cancel <-chan struct{}) bool { + d := time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second + if cap > 0 && d > cap { + d = cap + } select { - case <-time.After(time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second): + case <-time.After(d): return true case <-cancel: return false diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go index 0c8d9d224..ec7e84817 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/version.go +++ b/vendor/github.com/Azure/go-autorest/autorest/version.go @@ -19,7 +19,7 @@ import ( "runtime" ) -const number = "v12.0.0" +const number = "v12.3.0" var ( userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s", diff --git a/vendor/github.com/Azure/go-autorest/logger/LICENSE b/vendor/github.com/Azure/go-autorest/logger/LICENSE new file mode 100644 index 000000000..b9d6a27ea --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/logger/LICENSE @@ -0,0 +1,191 @@ + + 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 + + Copyright 2015 Microsoft Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/logger/go.mod b/vendor/github.com/Azure/go-autorest/logger/go.mod new file mode 100644 index 000000000..f22ed56bc --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/logger/go.mod @@ -0,0 +1,3 @@ +module github.com/Azure/go-autorest/logger + +go 1.12 diff --git a/vendor/github.com/Azure/go-autorest/tracing/LICENSE b/vendor/github.com/Azure/go-autorest/tracing/LICENSE new file mode 100644 index 000000000..b9d6a27ea --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/tracing/LICENSE @@ -0,0 +1,191 @@ + + 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 + + Copyright 2015 Microsoft Corporation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/tracing/go.mod b/vendor/github.com/Azure/go-autorest/tracing/go.mod new file mode 100644 index 000000000..b066b3e6e --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/tracing/go.mod @@ -0,0 +1,8 @@ +module github.com/Azure/go-autorest/tracing + +go 1.12 + +require ( + contrib.go.opencensus.io/exporter/ocagent v0.4.12 + go.opencensus.io v0.20.2 +) diff --git a/vendor/github.com/Azure/go-autorest/tracing/go.sum b/vendor/github.com/Azure/go-autorest/tracing/go.sum new file mode 100644 index 000000000..4e5548c91 --- /dev/null +++ b/vendor/github.com/Azure/go-autorest/tracing/go.sum @@ -0,0 +1,130 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc= +contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4= +github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/grpc-ecosystem/grpc-gateway v1.8.5 h1:2+KSC78XiO6Qy0hIjfc1OD9H+hsaJdJlb8Kqsd41CTE= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +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/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +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= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +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/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/github.com/appscode/jsonpatch/.gitignore b/vendor/github.com/appscode/jsonpatch/.gitignore deleted file mode 100644 index 0e9448e05..000000000 --- a/vendor/github.com/appscode/jsonpatch/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -.idea/ diff --git a/vendor/github.com/appscode/jsonpatch/.travis.yml b/vendor/github.com/appscode/jsonpatch/.travis.yml deleted file mode 100644 index 92f2439d7..000000000 --- a/vendor/github.com/appscode/jsonpatch/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go: - - 1.x - - tip - -env: - - GO111MODULE=on - -script: - - go test -v diff --git a/vendor/github.com/appscode/jsonpatch/README.md b/vendor/github.com/appscode/jsonpatch/README.md deleted file mode 100644 index bbbf72921..000000000 --- a/vendor/github.com/appscode/jsonpatch/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# jsonpatch - -[![Build Status](https://travis-ci.org/appscode/jsonpatch.svg?branch=master)](https://travis-ci.org/appscode/jsonpatch) -[![Go Report Card](https://goreportcard.com/badge/appscode/jsonpatch "Go Report Card")](https://goreportcard.com/report/appscode/jsonpatch) -[![GoDoc](https://godoc.org/github.com/appscode/jsonpatch?status.svg "GoDoc")](https://godoc.org/github.com/appscode/jsonpatch) - -As per http://jsonpatch.com JSON Patch is specified in RFC 6902 from the IETF. - -JSON Patch allows you to generate JSON that describes changes you want to make to a document, so you don't have to send the whole doc. JSON Patch format is supported by HTTP PATCH method, allowing for standards based partial updates via REST APIs. - -```console -go get github.com/appscode/jsonpatch -``` - -I tried some of the other "jsonpatch" go implementations, but none of them could diff two json documents and -generate format like jsonpatch.com specifies. Here's an example of the patch format: - -```json -[ - { "op": "replace", "path": "/baz", "value": "boo" }, - { "op": "add", "path": "/hello", "value": ["world"] }, - { "op": "remove", "path": "/foo"} -] - -``` -The API is super simple - -## example - -```go -package main - -import ( - "fmt" - "github.com/appscode/jsonpatch" -) - -var simpleA = `{"a":100, "b":200, "c":"hello"}` -var simpleB = `{"a":100, "b":200, "c":"goodbye"}` - -func main() { - patch, e := jsonpatch.CreatePatch([]byte(simpleA), []byte(simpleA)) - if e != nil { - fmt.Printf("Error creating JSON patch:%v", e) - return - } - for _, operation := range patch { - fmt.Printf("%s\n", operation.Json()) - } -} -``` - -This code needs more tests, as it's a highly recursive, type-fiddly monster. It's not a lot of code, but it has to deal with a lot of complexity. diff --git a/vendor/github.com/appscode/jsonpatch/go.mod b/vendor/github.com/appscode/jsonpatch/go.mod deleted file mode 100644 index 458d129ec..000000000 --- a/vendor/github.com/appscode/jsonpatch/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/appscode/jsonpatch - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v4.0.0+incompatible - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 -) diff --git a/vendor/github.com/appscode/jsonpatch/go.sum b/vendor/github.com/appscode/jsonpatch/go.sum deleted file mode 100644 index 0972e0e1a..000000000 --- a/vendor/github.com/appscode/jsonpatch/go.sum +++ /dev/null @@ -1,8 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/evanphx/json-patch v4.0.0+incompatible h1:xregGRMLBeuRcwiOTHRCsPPuzCQlqhxUPbqdw+zNkLc= -github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -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/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/vendor/github.com/evanphx/json-patch/patch.go b/vendor/github.com/evanphx/json-patch/patch.go index c9cf59021..1b5f95e61 100644 --- a/vendor/github.com/evanphx/json-patch/patch.go +++ b/vendor/github.com/evanphx/json-patch/patch.go @@ -6,6 +6,8 @@ import ( "fmt" "strconv" "strings" + + "github.com/pkg/errors" ) const ( @@ -24,6 +26,14 @@ var ( AccumulatedCopySizeLimit int64 = 0 ) +var ( + ErrTestFailed = errors.New("test failed") + ErrMissing = errors.New("missing value") + ErrUnknownType = errors.New("unknown object type") + ErrInvalid = errors.New("invalid state detected") + ErrInvalidIndex = errors.New("invalid index referenced") +) + type lazyNode struct { raw *json.RawMessage doc partialDoc @@ -31,10 +41,11 @@ type lazyNode struct { which int } -type operation map[string]*json.RawMessage +// Operation is a single JSON-Patch step, such as a single 'add' operation. +type Operation map[string]*json.RawMessage -// Patch is an ordered collection of operations. -type Patch []operation +// Patch is an ordered collection of Operations. +type Patch []Operation type partialDoc map[string]*lazyNode type partialArray []*lazyNode @@ -59,7 +70,7 @@ func (n *lazyNode) MarshalJSON() ([]byte, error) { case eAry: return json.Marshal(n.ary) default: - return nil, fmt.Errorf("Unknown type") + return nil, ErrUnknownType } } @@ -91,7 +102,7 @@ func (n *lazyNode) intoDoc() (*partialDoc, error) { } if n.raw == nil { - return nil, fmt.Errorf("Unable to unmarshal nil pointer as partial document") + return nil, ErrInvalid } err := json.Unmarshal(*n.raw, &n.doc) @@ -110,7 +121,7 @@ func (n *lazyNode) intoAry() (*partialArray, error) { } if n.raw == nil { - return nil, fmt.Errorf("Unable to unmarshal nil pointer as partial array") + return nil, ErrInvalid } err := json.Unmarshal(*n.raw, &n.ary) @@ -227,7 +238,8 @@ func (n *lazyNode) equal(o *lazyNode) bool { return true } -func (o operation) kind() string { +// Kind reads the "op" field of the Operation. +func (o Operation) Kind() string { if obj, ok := o["op"]; ok && obj != nil { var op string @@ -243,39 +255,41 @@ func (o operation) kind() string { return "unknown" } -func (o operation) path() string { +// Path reads the "path" field of the Operation. +func (o Operation) Path() (string, error) { if obj, ok := o["path"]; ok && obj != nil { var op string err := json.Unmarshal(*obj, &op) if err != nil { - return "unknown" + return "unknown", err } - return op + return op, nil } - return "unknown" + return "unknown", errors.Wrapf(ErrMissing, "operation missing path field") } -func (o operation) from() string { +// From reads the "from" field of the Operation. +func (o Operation) From() (string, error) { if obj, ok := o["from"]; ok && obj != nil { var op string err := json.Unmarshal(*obj, &op) if err != nil { - return "unknown" + return "unknown", err } - return op + return op, nil } - return "unknown" + return "unknown", errors.Wrapf(ErrMissing, "operation, missing from field") } -func (o operation) value() *lazyNode { +func (o Operation) value() *lazyNode { if obj, ok := o["value"]; ok { return newLazyNode(obj) } @@ -283,6 +297,23 @@ func (o operation) value() *lazyNode { return nil } +// ValueInterface decodes the operation value into an interface. +func (o Operation) ValueInterface() (interface{}, error) { + if obj, ok := o["value"]; ok && obj != nil { + var v interface{} + + err := json.Unmarshal(*obj, &v) + + if err != nil { + return nil, err + } + + return v, nil + } + + return nil, errors.Wrapf(ErrMissing, "operation, missing value field") +} + func isArray(buf []byte) bool { Loop: for _, c := range buf { @@ -359,7 +390,7 @@ func (d *partialDoc) get(key string) (*lazyNode, error) { func (d *partialDoc) remove(key string) error { _, ok := (*d)[key] if !ok { - return fmt.Errorf("Unable to remove nonexistent key: %s", key) + return errors.Wrapf(ErrMissing, "Unable to remove nonexistent key: %s", key) } delete(*d, key) @@ -385,7 +416,7 @@ func (d *partialArray) add(key string, val *lazyNode) error { idx, err := strconv.Atoi(key) if err != nil { - return err + return errors.Wrapf(err, "value was not a proper array index: '%s'", key) } sz := len(*d) + 1 @@ -395,12 +426,12 @@ func (d *partialArray) add(key string, val *lazyNode) error { cur := *d if idx >= len(ary) { - return fmt.Errorf("Unable to access invalid index: %d", idx) + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } if SupportNegativeIndices { if idx < -len(ary) { - return fmt.Errorf("Unable to access invalid index: %d", idx) + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } if idx < 0 { @@ -424,7 +455,7 @@ func (d *partialArray) get(key string) (*lazyNode, error) { } if idx >= len(*d) { - return nil, fmt.Errorf("Unable to access invalid index: %d", idx) + return nil, errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } return (*d)[idx], nil @@ -439,12 +470,12 @@ func (d *partialArray) remove(key string) error { cur := *d if idx >= len(cur) { - return fmt.Errorf("Unable to access invalid index: %d", idx) + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } if SupportNegativeIndices { if idx < -len(cur) { - return fmt.Errorf("Unable to access invalid index: %d", idx) + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } if idx < 0 { @@ -462,140 +493,189 @@ func (d *partialArray) remove(key string) error { } -func (p Patch) add(doc *container, op operation) error { - path := op.path() +func (p Patch) add(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(ErrMissing, "add operation failed to decode path") + } con, key := findObject(doc, path) if con == nil { - return fmt.Errorf("jsonpatch add operation does not apply: doc is missing path: \"%s\"", path) + return errors.Wrapf(ErrMissing, "add operation does not apply: doc is missing path: \"%s\"", path) + } + + err = con.add(key, op.value()) + if err != nil { + return errors.Wrapf(err, "error in add for path: '%s'", path) } - return con.add(key, op.value()) + return nil } -func (p Patch) remove(doc *container, op operation) error { - path := op.path() +func (p Patch) remove(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(ErrMissing, "remove operation failed to decode path") + } con, key := findObject(doc, path) if con == nil { - return fmt.Errorf("jsonpatch remove operation does not apply: doc is missing path: \"%s\"", path) + return errors.Wrapf(ErrMissing, "remove operation does not apply: doc is missing path: \"%s\"", path) + } + + err = con.remove(key) + if err != nil { + return errors.Wrapf(err, "error in remove for path: '%s'", path) } - return con.remove(key) + return nil } -func (p Patch) replace(doc *container, op operation) error { - path := op.path() +func (p Patch) replace(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(err, "replace operation failed to decode path") + } con, key := findObject(doc, path) if con == nil { - return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing path: %s", path) + return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing path: %s", path) } _, ok := con.get(key) if ok != nil { - return fmt.Errorf("jsonpatch replace operation does not apply: doc is missing key: %s", path) + return errors.Wrapf(ErrMissing, "replace operation does not apply: doc is missing key: %s", path) + } + + err = con.set(key, op.value()) + if err != nil { + return errors.Wrapf(err, "error in remove for path: '%s'", path) } - return con.set(key, op.value()) + return nil } -func (p Patch) move(doc *container, op operation) error { - from := op.from() +func (p Patch) move(doc *container, op Operation) error { + from, err := op.From() + if err != nil { + return errors.Wrapf(err, "move operation failed to decode from") + } con, key := findObject(doc, from) if con == nil { - return fmt.Errorf("jsonpatch move operation does not apply: doc is missing from path: %s", from) + return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing from path: %s", from) } val, err := con.get(key) if err != nil { - return err + return errors.Wrapf(err, "error in move for path: '%s'", key) } err = con.remove(key) if err != nil { - return err + return errors.Wrapf(err, "error in move for path: '%s'", key) } - path := op.path() + path, err := op.Path() + if err != nil { + return errors.Wrapf(err, "move operation failed to decode path") + } con, key = findObject(doc, path) if con == nil { - return fmt.Errorf("jsonpatch move operation does not apply: doc is missing destination path: %s", path) + return errors.Wrapf(ErrMissing, "move operation does not apply: doc is missing destination path: %s", path) + } + + err = con.add(key, val) + if err != nil { + return errors.Wrapf(err, "error in move for path: '%s'", path) } - return con.add(key, val) + return nil } -func (p Patch) test(doc *container, op operation) error { - path := op.path() +func (p Patch) test(doc *container, op Operation) error { + path, err := op.Path() + if err != nil { + return errors.Wrapf(err, "test operation failed to decode path") + } con, key := findObject(doc, path) if con == nil { - return fmt.Errorf("jsonpatch test operation does not apply: is missing path: %s", path) + return errors.Wrapf(ErrMissing, "test operation does not apply: is missing path: %s", path) } val, err := con.get(key) - if err != nil { - return err + return errors.Wrapf(err, "error in test for path: '%s'", path) } if val == nil { if op.value().raw == nil { return nil } - return fmt.Errorf("Testing value %s failed", path) + return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) } else if op.value() == nil { - return fmt.Errorf("Testing value %s failed", path) + return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) } if val.equal(op.value()) { return nil } - return fmt.Errorf("Testing value %s failed", path) + return errors.Wrapf(ErrTestFailed, "testing value %s failed", path) } -func (p Patch) copy(doc *container, op operation, accumulatedCopySize *int64) error { - from := op.from() +func (p Patch) copy(doc *container, op Operation, accumulatedCopySize *int64) error { + from, err := op.From() + if err != nil { + return errors.Wrapf(err, "copy operation failed to decode from") + } con, key := findObject(doc, from) if con == nil { - return fmt.Errorf("jsonpatch copy operation does not apply: doc is missing from path: %s", from) + return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing from path: %s", from) } val, err := con.get(key) if err != nil { - return err + return errors.Wrapf(err, "error in copy for from: '%s'", from) } - path := op.path() + path, err := op.Path() + if err != nil { + return errors.Wrapf(ErrMissing, "copy operation failed to decode path") + } con, key = findObject(doc, path) if con == nil { - return fmt.Errorf("jsonpatch copy operation does not apply: doc is missing destination path: %s", path) + return errors.Wrapf(ErrMissing, "copy operation does not apply: doc is missing destination path: %s", path) } valCopy, sz, err := deepCopy(val) if err != nil { - return err + return errors.Wrapf(err, "error while performing deep copy") } + (*accumulatedCopySize) += int64(sz) if AccumulatedCopySizeLimit > 0 && *accumulatedCopySize > AccumulatedCopySizeLimit { return NewAccumulatedCopySizeError(AccumulatedCopySizeLimit, *accumulatedCopySize) } - return con.add(key, valCopy) + err = con.add(key, valCopy) + if err != nil { + return errors.Wrapf(err, "error while adding value during copy") + } + + return nil } // Equal indicates if 2 JSON documents have the same structural equality. @@ -651,7 +731,7 @@ func (p Patch) ApplyIndent(doc []byte, indent string) ([]byte, error) { var accumulatedCopySize int64 for _, op := range p { - switch op.kind() { + switch op.Kind() { case "add": err = p.add(&pd, op) case "remove": @@ -665,7 +745,7 @@ func (p Patch) ApplyIndent(doc []byte, indent string) ([]byte, error) { case "copy": err = p.copy(&pd, op, &accumulatedCopySize) default: - err = fmt.Errorf("Unexpected kind: %s", op.kind()) + err = fmt.Errorf("Unexpected kind: %s", op.Kind()) } if err != nil { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/build_info.go b/vendor/github.com/prometheus/client_golang/prometheus/build_info.go new file mode 100644 index 000000000..288f0e854 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/build_info.go @@ -0,0 +1,29 @@ +// Copyright 2019 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. + +// +build go1.12 + +package prometheus + +import "runtime/debug" + +// readBuildInfo is a wrapper around debug.ReadBuildInfo for Go 1.12+. +func readBuildInfo() (path, version, sum string) { + path, version, sum = "unknown", "unknown", "unknown" + if bi, ok := debug.ReadBuildInfo(); ok { + path = bi.Main.Path + version = bi.Main.Version + sum = bi.Main.Sum + } + return +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go b/vendor/github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go new file mode 100644 index 000000000..6609e2877 --- /dev/null +++ b/vendor/github.com/prometheus/client_golang/prometheus/build_info_pre_1.12.go @@ -0,0 +1,22 @@ +// Copyright 2019 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. + +// +build !go1.12 + +package prometheus + +// readBuildInfo is a wrapper around debug.ReadBuildInfo for Go versions before +// 1.12. Remove this whole file once the minimum supported Go version is 1.12. +func readBuildInfo() (path, version, sum string) { + return "unknown", "unknown", "unknown" +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go index b108ec513..dc9247fed 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/go_collector.go @@ -36,7 +36,7 @@ type goCollector struct { msMaxAge time.Duration // Maximum allowed age of old memstats. } -// NewGoCollector returns a collector which exports metrics about the current Go +// NewGoCollector returns a collector that exports metrics about the current Go // process. This includes memory stats. To collect those, runtime.ReadMemStats // is called. This requires to “stop the world”, which usually only happens for // garbage collection (GC). Take the following implications into account when @@ -364,3 +364,33 @@ type memStatsMetrics []struct { eval func(*runtime.MemStats) float64 valType ValueType } + +// NewBuildInfoCollector returns a collector collecting a single metric +// "go_build_info" with the constant value 1 and three labels "path", "version", +// and "checksum". Their label values contain the main module path, version, and +// checksum, respectively. The labels will only have meaningful values if the +// binary is built with Go module support and from source code retrieved from +// the source repository (rather than the local file system). This is usually +// accomplished by building from outside of GOPATH, specifying the full address +// of the main package, e.g. "GO111MODULE=on go run +// github.com/prometheus/client_golang/examples/random". If built without Go +// module support, all label values will be "unknown". If built with Go module +// support but using the source code from the local file system, the "path" will +// be set appropriately, but "checksum" will be empty and "version" will be +// "(devel)". +// +// This collector uses only the build information for the main module. See +// https://github.com/povilasv/prommod for an example of a collector for the +// module dependencies. +func NewBuildInfoCollector() Collector { + path, version, sum := readBuildInfo() + c := &selfCollector{MustNewConstMetric( + NewDesc( + "go_build_info", + "Build information about the main Go module.", + nil, Labels{"path": path, "version": version, "checksum": sum}, + ), + GaugeValue, 1)} + c.init(c.self) + return c +} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go b/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go index 55176d58c..37d2026ac 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/process_collector.go @@ -126,7 +126,7 @@ func NewProcessCollector(opts ProcessCollectorOpts) Collector { } // Set up process metric collection if supported by the runtime. - if _, err := procfs.NewStat(); err == nil { + if _, err := procfs.NewDefaultFS(); err == nil { c.collectFn = c.processCollect } else { c.collectFn = func(ch chan<- Metric) { @@ -166,7 +166,7 @@ func (c *processCollector) processCollect(ch chan<- Metric) { return } - if stat, err := p.NewStat(); err == nil { + if stat, err := p.Stat(); err == nil { ch <- MustNewConstMetric(c.cpuTotal, CounterValue, stat.CPUTime()) ch <- MustNewConstMetric(c.vsize, GaugeValue, float64(stat.VirtualMemory())) ch <- MustNewConstMetric(c.rss, GaugeValue, float64(stat.ResidentMemory())) @@ -185,7 +185,7 @@ func (c *processCollector) processCollect(ch chan<- Metric) { c.reportError(ch, c.openFDs, err) } - if limits, err := p.NewLimits(); err == nil { + if limits, err := p.Limits(); err == nil { ch <- MustNewConstMetric(c.maxFDs, GaugeValue, float64(limits.OpenFiles)) ch <- MustNewConstMetric(c.maxVsize, GaugeValue, float64(limits.AddressSpace)) } else { diff --git a/vendor/github.com/prometheus/client_golang/prometheus/summary.go b/vendor/github.com/prometheus/client_golang/prometheus/summary.go index 1574b0fe7..ec663ec3d 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/summary.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/summary.go @@ -39,7 +39,7 @@ const quantileLabel = "quantile" // A typical use-case is the observation of request latencies. By default, a // Summary provides the median, the 90th and the 99th percentile of the latency // as rank estimations. However, the default behavior will change in the -// upcoming v0.10 of the library. There will be no rank estimations at all by +// upcoming v1.0.0 of the library. There will be no rank estimations at all by // default. For a sane transition, it is recommended to set the desired rank // estimations explicitly. // @@ -61,7 +61,7 @@ type Summary interface { // DefObjectives are the default Summary quantile values. // // Deprecated: DefObjectives will not be used as the default objectives in -// v0.10 of the library. The default Summary will have no quantiles then. +// v1.0.0 of the library. The default Summary will have no quantiles then. var ( DefObjectives = map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001} @@ -86,7 +86,7 @@ const ( // mandatory to set Name to a non-empty string. While all other fields are // optional and can safely be left at their zero value, it is recommended to set // a help string and to explicitly set the Objectives field to the desired value -// as the default value will change in the upcoming v0.10 of the library. +// as the default value will change in the upcoming v1.0.0 of the library. type SummaryOpts struct { // Namespace, Subsystem, and Name are components of the fully-qualified // name of the Summary (created by joining these components with @@ -128,7 +128,7 @@ type SummaryOpts struct { // set it to an empty map (i.e. map[float64]float64{}). // // Note that the current value of DefObjectives is deprecated. It will - // be replaced by an empty map in v0.10 of the library. Please + // be replaced by an empty map in v1.0.0 of the library. Please // explicitly set Objectives to the desired value to avoid problems // during the transition. Objectives map[float64]float64 diff --git a/vendor/github.com/prometheus/procfs/README.md b/vendor/github.com/prometheus/procfs/README.md index 951c043bc..6f8850feb 100644 --- a/vendor/github.com/prometheus/procfs/README.md +++ b/vendor/github.com/prometheus/procfs/README.md @@ -19,7 +19,14 @@ point is initialized, and then the stat information is read. ```go fs, err := procfs.NewFS("/proc") -stats, err := fs.NewStat() +stats, err := fs.Stat() +``` + +Some sub-packages such as `blockdevice`, require access to both the proc and sys filesystems. + +```go + fs, err := blockdevice.NewFS("/proc", "/sys") + stats, err := fs.ProcDiskstats() ``` ## Building and Testing @@ -30,7 +37,7 @@ changes to the library, the `make test` command can be used to run the API test ### Updating Test Fixtures The procfs library includes a set of test fixtures which include many example files from -the `/proc` and `/sys` filesystems. These fixtures are included as a ttar (text tar) file +the `/proc` and `/sys` filesystems. These fixtures are included as a [ttar](https://github.com/ideaship/ttar) file which is extracted automatically during testing. To add/update the test fixtures, first ensure the `fixtures` directory is up to date by removing the existing directory and then extracting the ttar file using `make fixtures/.unpacked` or just `make test`. diff --git a/vendor/github.com/prometheus/procfs/buddyinfo.go b/vendor/github.com/prometheus/procfs/buddyinfo.go index 5cd22a837..63d4229a4 100644 --- a/vendor/github.com/prometheus/procfs/buddyinfo.go +++ b/vendor/github.com/prometheus/procfs/buddyinfo.go @@ -31,18 +31,8 @@ type BuddyInfo struct { Sizes []float64 } -// NewBuddyInfo reads the buddyinfo statistics. -func NewBuddyInfo() ([]BuddyInfo, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return nil, err - } - - return fs.NewBuddyInfo() -} - // NewBuddyInfo reads the buddyinfo statistics from the specified `proc` filesystem. -func (fs FS) NewBuddyInfo() ([]BuddyInfo, error) { +func (fs FS) BuddyInfo() ([]BuddyInfo, error) { file, err := os.Open(fs.proc.Path("buddyinfo")) if err != nil { return nil, err diff --git a/vendor/github.com/prometheus/procfs/fixtures.ttar b/vendor/github.com/prometheus/procfs/fixtures.ttar index 0ada8ae13..951d909af 100644 --- a/vendor/github.com/prometheus/procfs/fixtures.ttar +++ b/vendor/github.com/prometheus/procfs/fixtures.ttar @@ -75,7 +75,7 @@ Max realtime timeout unlimited unlimited us Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/26231/mountstats -Lines: 19 +Lines: 20 device rootfs mounted on / with fstype rootfs device sysfs mounted on /sys with fstype sysfs device proc mounted on /proc with fstype proc @@ -94,6 +94,7 @@ device 192.168.1.1:/srv/test mounted on /mnt/nfs/test with fstype nfs4 statvers= NULL: 0 0 0 0 0 0 0 0 READ: 1298 1298 0 207680 1210292152 6 79386 79407 WRITE: 0 0 0 0 0 0 0 0 + ACCESS: 2927395007 2927394995 0 526931094212 362996810236 18446743919241604546 1667369447 1953587717 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -120,6 +121,11 @@ SymlinkTo: net:[4026531993] Path: fixtures/proc/26231/root SymlinkTo: / # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/26231/stat +Lines: 1 +26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/26231/status Lines: 53 @@ -177,11 +183,6 @@ voluntary_ctxt_switches: 4742839 nonvoluntary_ctxt_switches: 1727500 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/stat -Lines: 1 -26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/26232 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -459,6 +460,26 @@ proc4 2 2 10853 proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/net/unix +Lines: 6 +Num RefCount Protocol Flags Type St Inode Path +0000000000000000: 00000002 00000000 00010000 0001 01 3442596 /var/run/postgresql/.s.PGSQL.5432 +0000000000000000: 0000000a 00000000 00010000 0005 01 10061 /run/udev/control +0000000000000000: 00000007 00000000 00000000 0002 01 12392 /dev/log +0000000000000000: 00000003 00000000 00000000 0001 03 4787297 /var/run/postgresql/.s.PGSQL.5432 +0000000000000000: 00000003 00000000 00000000 0001 03 5091797 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/net/unix_without_inode +Lines: 6 +Num RefCount Protocol Flags Type St Path +0000000000000000: 00000002 00000000 00010000 0001 01 /var/run/postgresql/.s.PGSQL.5432 +0000000000000000: 0000000a 00000000 00010000 0005 01 /run/udev/control +0000000000000000: 00000007 00000000 00000000 0002 01 /dev/log +0000000000000000: 00000003 00000000 00000000 0001 03 /var/run/postgresql/.s.PGSQL.5432 +0000000000000000: 00000003 00000000 00000000 0001 03 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/net/xfrm_stat Lines: 28 XfrmInError 1 diff --git a/vendor/github.com/prometheus/procfs/fs.go b/vendor/github.com/prometheus/procfs/fs.go index 5b4a1f0bf..0102ab0fd 100644 --- a/vendor/github.com/prometheus/procfs/fs.go +++ b/vendor/github.com/prometheus/procfs/fs.go @@ -26,6 +26,12 @@ type FS struct { // DefaultMountPoint is the common mount point of the proc filesystem. const DefaultMountPoint = fs.DefaultProcMountPoint +// NewDefaultFS returns a new proc FS mounted under the default proc mountPoint. +// It will error if the mount point directory can't be read or is a file. +func NewDefaultFS() (FS, error) { + return NewFS(DefaultMountPoint) +} + // NewFS returns a new proc FS mounted under the given proc mountPoint. It will error // if the mount point directory can't be read or is a file. func NewFS(mountPoint string) (FS, error) { diff --git a/vendor/github.com/prometheus/procfs/ipvs.go b/vendor/github.com/prometheus/procfs/ipvs.go index 41e645d23..2d6cb8d1c 100644 --- a/vendor/github.com/prometheus/procfs/ipvs.go +++ b/vendor/github.com/prometheus/procfs/ipvs.go @@ -62,18 +62,8 @@ type IPVSBackendStatus struct { Weight uint64 } -// NewIPVSStats reads the IPVS statistics. -func NewIPVSStats() (IPVSStats, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return IPVSStats{}, err - } - - return fs.NewIPVSStats() -} - -// NewIPVSStats reads the IPVS statistics from the specified `proc` filesystem. -func (fs FS) NewIPVSStats() (IPVSStats, error) { +// IPVSStats reads the IPVS statistics from the specified `proc` filesystem. +func (fs FS) IPVSStats() (IPVSStats, error) { file, err := os.Open(fs.proc.Path("net/ip_vs_stats")) if err != nil { return IPVSStats{}, err @@ -131,18 +121,8 @@ func parseIPVSStats(file io.Reader) (IPVSStats, error) { return stats, nil } -// NewIPVSBackendStatus reads and returns the status of all (virtual,real) server pairs. -func NewIPVSBackendStatus() ([]IPVSBackendStatus, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return []IPVSBackendStatus{}, err - } - - return fs.NewIPVSBackendStatus() -} - -// NewIPVSBackendStatus reads and returns the status of all (virtual,real) server pairs from the specified `proc` filesystem. -func (fs FS) NewIPVSBackendStatus() ([]IPVSBackendStatus, error) { +// IPVSBackendStatus reads and returns the status of all (virtual,real) server pairs from the specified `proc` filesystem. +func (fs FS) IPVSBackendStatus() ([]IPVSBackendStatus, error) { file, err := os.Open(fs.proc.Path("net/ip_vs")) if err != nil { return nil, err diff --git a/vendor/github.com/prometheus/procfs/mdstat.go b/vendor/github.com/prometheus/procfs/mdstat.go index 6ac7a12f9..71c106782 100644 --- a/vendor/github.com/prometheus/procfs/mdstat.go +++ b/vendor/github.com/prometheus/procfs/mdstat.go @@ -42,64 +42,64 @@ type MDStat struct { BlocksSynced int64 } -// ParseMDStat parses an mdstat-file and returns a struct with the relevant infos. -func (fs FS) ParseMDStat() (mdstates []MDStat, err error) { - mdStatusFilePath := fs.proc.Path("mdstat") - content, err := ioutil.ReadFile(mdStatusFilePath) +// MDStat parses an mdstat-file (/proc/mdstat) and returns a slice of +// structs containing the relevant info. More information available here: +// https://raid.wiki.kernel.org/index.php/Mdstat +func (fs FS) MDStat() ([]MDStat, error) { + data, err := ioutil.ReadFile(fs.proc.Path("mdstat")) if err != nil { - return []MDStat{}, fmt.Errorf("error parsing %s: %s", mdStatusFilePath, err) + return nil, fmt.Errorf("error parsing mdstat %s: %s", fs.proc.Path("mdstat"), err) } + mdstat, err := parseMDStat(data) + if err != nil { + return nil, fmt.Errorf("error parsing mdstat %s: %s", fs.proc.Path("mdstat"), err) + } + return mdstat, nil +} - mdStates := []MDStat{} - lines := strings.Split(string(content), "\n") +// parseMDStat parses data from mdstat file (/proc/mdstat) and returns a slice of +// structs containing the relevant info. +func parseMDStat(mdstatData []byte) ([]MDStat, error) { + mdStats := []MDStat{} + lines := strings.Split(string(mdstatData), "\n") for i, l := range lines { - if l == "" { - continue - } - if l[0] == ' ' { - continue - } - if strings.HasPrefix(l, "Personalities") || strings.HasPrefix(l, "unused") { + if strings.TrimSpace(l) == "" || l[0] == ' ' || + strings.HasPrefix(l, "Personalities") || strings.HasPrefix(l, "unused") { continue } - mainLine := strings.Split(l, " ") - if len(mainLine) < 3 { - return mdStates, fmt.Errorf("error parsing mdline: %s", l) + deviceFields := strings.Fields(l) + if len(deviceFields) < 3 { + return nil, fmt.Errorf("not enough fields in mdline (expected at least 3): %s", l) } - mdName := mainLine[0] - activityState := mainLine[2] + mdName := deviceFields[0] + activityState := deviceFields[2] if len(lines) <= i+3 { - return mdStates, fmt.Errorf( - "error parsing %s: too few lines for md device %s", - mdStatusFilePath, - mdName, - ) + return mdStats, fmt.Errorf("missing lines for md device %s", mdName) } - active, total, size, err := evalStatusline(lines[i+1]) + active, total, size, err := evalStatusLine(lines[i+1]) if err != nil { - return mdStates, fmt.Errorf("error parsing %s: %s", mdStatusFilePath, err) + return nil, err } - // j is the line number of the syncing-line. - j := i + 2 + syncLineIdx := i + 2 if strings.Contains(lines[i+2], "bitmap") { // skip bitmap line - j = i + 3 + syncLineIdx++ } - // If device is syncing at the moment, get the number of currently + // If device is recovering/syncing at the moment, get the number of currently // synced bytes, otherwise that number equals the size of the device. syncedBlocks := size - if strings.Contains(lines[j], "recovery") || strings.Contains(lines[j], "resync") { - syncedBlocks, err = evalBuildline(lines[j]) + if strings.Contains(lines[syncLineIdx], "recovery") || strings.Contains(lines[syncLineIdx], "resync") { + syncedBlocks, err = evalRecoveryLine(lines[syncLineIdx]) if err != nil { - return mdStates, fmt.Errorf("error parsing %s: %s", mdStatusFilePath, err) + return nil, err } } - mdStates = append(mdStates, MDStat{ + mdStats = append(mdStats, MDStat{ Name: mdName, ActivityState: activityState, DisksActive: active, @@ -109,10 +109,10 @@ func (fs FS) ParseMDStat() (mdstates []MDStat, err error) { }) } - return mdStates, nil + return mdStats, nil } -func evalStatusline(statusline string) (active, total, size int64, err error) { +func evalStatusLine(statusline string) (active, total, size int64, err error) { matches := statuslineRE.FindStringSubmatch(statusline) if len(matches) != 4 { return 0, 0, 0, fmt.Errorf("unexpected statusline: %s", statusline) @@ -136,7 +136,7 @@ func evalStatusline(statusline string) (active, total, size int64, err error) { return active, total, size, nil } -func evalBuildline(buildline string) (syncedBlocks int64, err error) { +func evalRecoveryLine(buildline string) (syncedBlocks int64, err error) { matches := buildlineRE.FindStringSubmatch(buildline) if len(matches) != 2 { return 0, fmt.Errorf("unexpected buildline: %s", buildline) diff --git a/vendor/github.com/prometheus/procfs/mountstats.go b/vendor/github.com/prometheus/procfs/mountstats.go index 7e8f04411..35b2ef351 100644 --- a/vendor/github.com/prometheus/procfs/mountstats.go +++ b/vendor/github.com/prometheus/procfs/mountstats.go @@ -181,11 +181,11 @@ type NFSOperationStats struct { // Number of bytes received for this operation, including RPC headers and payload. BytesReceived uint64 // Duration all requests spent queued for transmission before they were sent. - CumulativeQueueTime time.Duration + CumulativeQueueMilliseconds uint64 // Duration it took to get a reply back after the request was transmitted. - CumulativeTotalResponseTime time.Duration + CumulativeTotalResponseMilliseconds uint64 // Duration from when a request was enqueued to when it was completely handled. - CumulativeTotalRequestTime time.Duration + CumulativeTotalRequestMilliseconds uint64 } // A NFSTransportStats contains statistics for the NFS mount RPC requests and @@ -204,7 +204,7 @@ type NFSTransportStats struct { // spent waiting for connections to the server to be established. ConnectIdleTime uint64 // Duration since the NFS mount last saw any RPC traffic. - IdleTime time.Duration + IdleTimeSeconds uint64 // Number of RPC requests for this mount sent to the NFS server. Sends uint64 // Number of RPC responses for this mount received from the NFS server. @@ -524,15 +524,15 @@ func parseNFSOperationStats(s *bufio.Scanner) ([]NFSOperationStats, error) { } ops = append(ops, NFSOperationStats{ - Operation: strings.TrimSuffix(ss[0], ":"), - Requests: ns[0], - Transmissions: ns[1], - MajorTimeouts: ns[2], - BytesSent: ns[3], - BytesReceived: ns[4], - CumulativeQueueTime: time.Duration(ns[5]) * time.Millisecond, - CumulativeTotalResponseTime: time.Duration(ns[6]) * time.Millisecond, - CumulativeTotalRequestTime: time.Duration(ns[7]) * time.Millisecond, + Operation: strings.TrimSuffix(ss[0], ":"), + Requests: ns[0], + Transmissions: ns[1], + MajorTimeouts: ns[2], + BytesSent: ns[3], + BytesReceived: ns[4], + CumulativeQueueMilliseconds: ns[5], + CumulativeTotalResponseMilliseconds: ns[6], + CumulativeTotalRequestMilliseconds: ns[7], }) } @@ -608,7 +608,7 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats Bind: ns[1], Connect: ns[2], ConnectIdleTime: ns[3], - IdleTime: time.Duration(ns[4]) * time.Second, + IdleTimeSeconds: ns[4], Sends: ns[5], Receives: ns[6], BadTransactionIDs: ns[7], diff --git a/vendor/github.com/prometheus/procfs/net_dev.go b/vendor/github.com/prometheus/procfs/net_dev.go index 8249c9841..a0b7a0119 100644 --- a/vendor/github.com/prometheus/procfs/net_dev.go +++ b/vendor/github.com/prometheus/procfs/net_dev.go @@ -47,23 +47,13 @@ type NetDevLine struct { // are interface names. type NetDev map[string]NetDevLine -// NewNetDev returns kernel/system statistics read from /proc/net/dev. -func NewNetDev() (NetDev, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return nil, err - } - - return fs.NewNetDev() -} - -// NewNetDev returns kernel/system statistics read from /proc/net/dev. -func (fs FS) NewNetDev() (NetDev, error) { +// NetDev returns kernel/system statistics read from /proc/net/dev. +func (fs FS) NetDev() (NetDev, error) { return newNetDev(fs.proc.Path("net/dev")) } -// NewNetDev returns kernel/system statistics read from /proc/[pid]/net/dev. -func (p Proc) NewNetDev() (NetDev, error) { +// NetDev returns kernel/system statistics read from /proc/[pid]/net/dev. +func (p Proc) NetDev() (NetDev, error) { return newNetDev(p.path("net/dev")) } diff --git a/vendor/github.com/prometheus/procfs/net_unix.go b/vendor/github.com/prometheus/procfs/net_unix.go new file mode 100644 index 000000000..240340a83 --- /dev/null +++ b/vendor/github.com/prometheus/procfs/net_unix.go @@ -0,0 +1,275 @@ +// Copyright 2018 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "errors" + "fmt" + "io" + "os" + "strconv" + "strings" +) + +// For the proc file format details, +// see https://elixir.bootlin.com/linux/v4.17/source/net/unix/af_unix.c#L2815 +// and https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/net.h#L48. + +const ( + netUnixKernelPtrIdx = iota + netUnixRefCountIdx + _ + netUnixFlagsIdx + netUnixTypeIdx + netUnixStateIdx + netUnixInodeIdx + + // Inode and Path are optional. + netUnixStaticFieldsCnt = 6 +) + +const ( + netUnixTypeStream = 1 + netUnixTypeDgram = 2 + netUnixTypeSeqpacket = 5 + + netUnixFlagListen = 1 << 16 + + netUnixStateUnconnected = 1 + netUnixStateConnecting = 2 + netUnixStateConnected = 3 + netUnixStateDisconnected = 4 +) + +var errInvalidKernelPtrFmt = errors.New("Invalid Num(the kernel table slot number) format") + +// NetUnixType is the type of the type field. +type NetUnixType uint64 + +// NetUnixFlags is the type of the flags field. +type NetUnixFlags uint64 + +// NetUnixState is the type of the state field. +type NetUnixState uint64 + +// NetUnixLine represents a line of /proc/net/unix. +type NetUnixLine struct { + KernelPtr string + RefCount uint64 + Protocol uint64 + Flags NetUnixFlags + Type NetUnixType + State NetUnixState + Inode uint64 + Path string +} + +// NetUnix holds the data read from /proc/net/unix. +type NetUnix struct { + Rows []*NetUnixLine +} + +// NewNetUnix returns data read from /proc/net/unix. +func NewNetUnix() (*NetUnix, error) { + fs, err := NewFS(DefaultMountPoint) + if err != nil { + return nil, err + } + + return fs.NewNetUnix() +} + +// NewNetUnix returns data read from /proc/net/unix. +func (fs FS) NewNetUnix() (*NetUnix, error) { + return NewNetUnixByPath(fs.proc.Path("net/unix")) +} + +// NewNetUnixByPath returns data read from /proc/net/unix by file path. +// It might returns an error with partial parsed data, if an error occur after some data parsed. +func NewNetUnixByPath(path string) (*NetUnix, error) { + f, err := os.Open(path) + if err != nil { + return nil, err + } + defer f.Close() + return NewNetUnixByReader(f) +} + +// NewNetUnixByReader returns data read from /proc/net/unix by a reader. +// It might returns an error with partial parsed data, if an error occur after some data parsed. +func NewNetUnixByReader(reader io.Reader) (*NetUnix, error) { + nu := &NetUnix{ + Rows: make([]*NetUnixLine, 0, 32), + } + scanner := bufio.NewScanner(reader) + // Omit the header line. + scanner.Scan() + header := scanner.Text() + // From the man page of proc(5), it does not contain an Inode field, + // but in actually it exists. + // This code works for both cases. + hasInode := strings.Contains(header, "Inode") + + minFieldsCnt := netUnixStaticFieldsCnt + if hasInode { + minFieldsCnt++ + } + for scanner.Scan() { + line := scanner.Text() + item, err := nu.parseLine(line, hasInode, minFieldsCnt) + if err != nil { + return nu, err + } + nu.Rows = append(nu.Rows, item) + } + + return nu, scanner.Err() +} + +func (u *NetUnix) parseLine(line string, hasInode bool, minFieldsCnt int) (*NetUnixLine, error) { + fields := strings.Fields(line) + fieldsLen := len(fields) + if fieldsLen < minFieldsCnt { + return nil, fmt.Errorf( + "Parse Unix domain failed: expect at least %d fields but got %d", + minFieldsCnt, fieldsLen) + } + kernelPtr, err := u.parseKernelPtr(fields[netUnixKernelPtrIdx]) + if err != nil { + return nil, fmt.Errorf("Parse Unix domain num(%s) failed: %s", fields[netUnixKernelPtrIdx], err) + } + users, err := u.parseUsers(fields[netUnixRefCountIdx]) + if err != nil { + return nil, fmt.Errorf("Parse Unix domain ref count(%s) failed: %s", fields[netUnixRefCountIdx], err) + } + flags, err := u.parseFlags(fields[netUnixFlagsIdx]) + if err != nil { + return nil, fmt.Errorf("Parse Unix domain flags(%s) failed: %s", fields[netUnixFlagsIdx], err) + } + typ, err := u.parseType(fields[netUnixTypeIdx]) + if err != nil { + return nil, fmt.Errorf("Parse Unix domain type(%s) failed: %s", fields[netUnixTypeIdx], err) + } + state, err := u.parseState(fields[netUnixStateIdx]) + if err != nil { + return nil, fmt.Errorf("Parse Unix domain state(%s) failed: %s", fields[netUnixStateIdx], err) + } + var inode uint64 + if hasInode { + inodeStr := fields[netUnixInodeIdx] + inode, err = u.parseInode(inodeStr) + if err != nil { + return nil, fmt.Errorf("Parse Unix domain inode(%s) failed: %s", inodeStr, err) + } + } + + nuLine := &NetUnixLine{ + KernelPtr: kernelPtr, + RefCount: users, + Type: typ, + Flags: flags, + State: state, + Inode: inode, + } + + // Path field is optional. + if fieldsLen > minFieldsCnt { + pathIdx := netUnixInodeIdx + 1 + if !hasInode { + pathIdx-- + } + nuLine.Path = fields[pathIdx] + } + + return nuLine, nil +} + +func (u NetUnix) parseKernelPtr(str string) (string, error) { + if !strings.HasSuffix(str, ":") { + return "", errInvalidKernelPtrFmt + } + return str[:len(str)-1], nil +} + +func (u NetUnix) parseUsers(hexStr string) (uint64, error) { + return strconv.ParseUint(hexStr, 16, 32) +} + +func (u NetUnix) parseProtocol(hexStr string) (uint64, error) { + return strconv.ParseUint(hexStr, 16, 32) +} + +func (u NetUnix) parseType(hexStr string) (NetUnixType, error) { + typ, err := strconv.ParseUint(hexStr, 16, 16) + if err != nil { + return 0, err + } + return NetUnixType(typ), nil +} + +func (u NetUnix) parseFlags(hexStr string) (NetUnixFlags, error) { + flags, err := strconv.ParseUint(hexStr, 16, 32) + if err != nil { + return 0, err + } + return NetUnixFlags(flags), nil +} + +func (u NetUnix) parseState(hexStr string) (NetUnixState, error) { + st, err := strconv.ParseInt(hexStr, 16, 8) + if err != nil { + return 0, err + } + return NetUnixState(st), nil +} + +func (u NetUnix) parseInode(inodeStr string) (uint64, error) { + return strconv.ParseUint(inodeStr, 10, 64) +} + +func (t NetUnixType) String() string { + switch t { + case netUnixTypeStream: + return "stream" + case netUnixTypeDgram: + return "dgram" + case netUnixTypeSeqpacket: + return "seqpacket" + } + return "unknown" +} + +func (f NetUnixFlags) String() string { + switch f { + case netUnixFlagListen: + return "listen" + default: + return "default" + } +} + +func (s NetUnixState) String() string { + switch s { + case netUnixStateUnconnected: + return "unconnected" + case netUnixStateConnecting: + return "connecting" + case netUnixStateConnected: + return "connected" + case netUnixStateDisconnected: + return "disconnected" + } + return "unknown" +} diff --git a/vendor/github.com/prometheus/procfs/proc.go b/vendor/github.com/prometheus/procfs/proc.go index 8e38493a8..8a8430147 100644 --- a/vendor/github.com/prometheus/procfs/proc.go +++ b/vendor/github.com/prometheus/procfs/proc.go @@ -54,7 +54,7 @@ func NewProc(pid int) (Proc, error) { if err != nil { return Proc{}, err } - return fs.NewProc(pid) + return fs.Proc(pid) } // AllProcs returns a list of all currently available processes under /proc. @@ -76,11 +76,18 @@ func (fs FS) Self() (Proc, error) { if err != nil { return Proc{}, err } - return fs.NewProc(pid) + return fs.Proc(pid) } // NewProc returns a process for the given pid. +// +// Deprecated: use fs.Proc() instead func (fs FS) NewProc(pid int) (Proc, error) { + return fs.Proc(pid) +} + +// Proc returns a process for the given pid. +func (fs FS) Proc(pid int) (Proc, error) { if _, err := os.Stat(fs.proc.Path(strconv.Itoa(pid))); err != nil { return Proc{}, err } diff --git a/vendor/github.com/prometheus/procfs/proc_io.go b/vendor/github.com/prometheus/procfs/proc_io.go index 0251c83bf..0ff89b1ce 100644 --- a/vendor/github.com/prometheus/procfs/proc_io.go +++ b/vendor/github.com/prometheus/procfs/proc_io.go @@ -39,8 +39,8 @@ type ProcIO struct { CancelledWriteBytes int64 } -// NewIO creates a new ProcIO instance from a given Proc instance. -func (p Proc) NewIO() (ProcIO, error) { +// IO creates a new ProcIO instance from a given Proc instance. +func (p Proc) IO() (ProcIO, error) { pio := ProcIO{} f, err := os.Open(p.path("io")) diff --git a/vendor/github.com/prometheus/procfs/proc_limits.go b/vendor/github.com/prometheus/procfs/proc_limits.go index f04ba6fda..91ee24df8 100644 --- a/vendor/github.com/prometheus/procfs/proc_limits.go +++ b/vendor/github.com/prometheus/procfs/proc_limits.go @@ -78,7 +78,14 @@ var ( ) // NewLimits returns the current soft limits of the process. +// +// Deprecated: use p.Limits() instead func (p Proc) NewLimits() (ProcLimits, error) { + return p.Limits() +} + +// Limits returns the current soft limits of the process. +func (p Proc) Limits() (ProcLimits, error) { f, err := os.Open(p.path("limits")) if err != nil { return ProcLimits{}, err diff --git a/vendor/github.com/prometheus/procfs/proc_ns.go b/vendor/github.com/prometheus/procfs/proc_ns.go index 3f8d6d623..c66740ff7 100644 --- a/vendor/github.com/prometheus/procfs/proc_ns.go +++ b/vendor/github.com/prometheus/procfs/proc_ns.go @@ -29,9 +29,9 @@ type Namespace struct { // Namespaces contains all of the namespaces that the process is contained in. type Namespaces map[string]Namespace -// NewNamespaces reads from /proc//ns/* to get the namespaces of which the +// Namespaces reads from /proc//ns/* to get the namespaces of which the // process is a member. -func (p Proc) NewNamespaces() (Namespaces, error) { +func (p Proc) Namespaces() (Namespaces, error) { d, err := os.Open(p.path("ns")) if err != nil { return nil, err diff --git a/vendor/github.com/prometheus/procfs/proc_psi.go b/vendor/github.com/prometheus/procfs/proc_psi.go index a23d4c0f0..46fe26626 100644 --- a/vendor/github.com/prometheus/procfs/proc_psi.go +++ b/vendor/github.com/prometheus/procfs/proc_psi.go @@ -51,19 +51,10 @@ type PSIStats struct { Full *PSILine } -// NewPSIStatsForResource reads pressure stall information for the specified -// resource. At time of writing this can be either "cpu", "memory" or "io". -func NewPSIStatsForResource(resource string) (PSIStats, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return PSIStats{}, err - } - - return fs.NewPSIStatsForResource(resource) -} - -// NewPSIStatsForResource reads pressure stall information from /proc/pressure/ -func (fs FS) NewPSIStatsForResource(resource string) (PSIStats, error) { +// PSIStatsForResource reads pressure stall information for the specified +// resource from /proc/pressure/. At time of writing this can be +// either "cpu", "memory" or "io". +func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) { file, err := os.Open(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource))) if err != nil { return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %s", resource) diff --git a/vendor/github.com/prometheus/procfs/proc_stat.go b/vendor/github.com/prometheus/procfs/proc_stat.go index 4c8b03ced..6ed98a8ae 100644 --- a/vendor/github.com/prometheus/procfs/proc_stat.go +++ b/vendor/github.com/prometheus/procfs/proc_stat.go @@ -105,7 +105,14 @@ type ProcStat struct { } // NewStat returns the current status information of the process. +// +// Deprecated: use NewStat() instead func (p Proc) NewStat() (ProcStat, error) { + return p.Stat() +} + +// Stat returns the current status information of the process. +func (p Proc) Stat() (ProcStat, error) { f, err := os.Open(p.path("stat")) if err != nil { return ProcStat{}, err @@ -178,7 +185,7 @@ func (s ProcStat) ResidentMemory() int { // StartTime returns the unix timestamp of the process in seconds. func (s ProcStat) StartTime() (float64, error) { fs := FS{proc: s.proc} - stat, err := fs.NewStat() + stat, err := fs.Stat() if err != nil { return 0, err } diff --git a/vendor/github.com/prometheus/procfs/stat.go b/vendor/github.com/prometheus/procfs/stat.go index 44c9af1b0..6661ee03a 100644 --- a/vendor/github.com/prometheus/procfs/stat.go +++ b/vendor/github.com/prometheus/procfs/stat.go @@ -20,6 +20,8 @@ import ( "os" "strconv" "strings" + + "github.com/prometheus/procfs/internal/fs" ) // CPUStat shows how much time the cpu spend in various stages. @@ -78,16 +80,6 @@ type Stat struct { SoftIRQ SoftIRQStat } -// NewStat returns kernel/system statistics read from /proc/stat. -func NewStat() (Stat, error) { - fs, err := NewFS(DefaultMountPoint) - if err != nil { - return Stat{}, err - } - - return fs.NewStat() -} - // Parse a cpu statistics line and returns the CPUStat struct plus the cpu id (or -1 for the overall sum). func parseCPUStat(line string) (CPUStat, int64, error) { cpuStat := CPUStat{} @@ -149,9 +141,29 @@ func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) { return softIRQStat, total, nil } -// NewStat returns an information about current kernel/system statistics. +// NewStat returns information about current cpu/process statistics. +// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt +// +// Deprecated: use fs.Stat() instead +func NewStat() (Stat, error) { + fs, err := NewFS(fs.DefaultProcMountPoint) + if err != nil { + return Stat{}, err + } + return fs.Stat() +} + +// NewStat returns information about current cpu/process statistics. +// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt +// +// Deprecated: use fs.Stat() instead func (fs FS) NewStat() (Stat, error) { - // See https://www.kernel.org/doc/Documentation/filesystems/proc.txt + return fs.Stat() +} + +// Stat returns information about current cpu/process statistics. +// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt +func (fs FS) Stat() (Stat, error) { f, err := os.Open(fs.proc.Path("stat")) if err != nil { diff --git a/vendor/gopkg.in/robfig/cron.v2/.gitignore b/vendor/github.com/robfig/cron/v3/.gitignore similarity index 100% rename from vendor/gopkg.in/robfig/cron.v2/.gitignore rename to vendor/github.com/robfig/cron/v3/.gitignore diff --git a/vendor/gopkg.in/robfig/cron.v2/.travis.yml b/vendor/github.com/robfig/cron/v3/.travis.yml similarity index 100% rename from vendor/gopkg.in/robfig/cron.v2/.travis.yml rename to vendor/github.com/robfig/cron/v3/.travis.yml diff --git a/vendor/gopkg.in/robfig/cron.v2/LICENSE b/vendor/github.com/robfig/cron/v3/LICENSE similarity index 100% rename from vendor/gopkg.in/robfig/cron.v2/LICENSE rename to vendor/github.com/robfig/cron/v3/LICENSE diff --git a/vendor/github.com/robfig/cron/v3/README.md b/vendor/github.com/robfig/cron/v3/README.md new file mode 100644 index 000000000..8db4f550f --- /dev/null +++ b/vendor/github.com/robfig/cron/v3/README.md @@ -0,0 +1,125 @@ +[![GoDoc](http://godoc.org/github.com/robfig/cron?status.png)](http://godoc.org/github.com/robfig/cron) +[![Build Status](https://travis-ci.org/robfig/cron.svg?branch=master)](https://travis-ci.org/robfig/cron) + +# cron + +Cron V3 has been released! + +To download the specific tagged release, run: + + go get github.com/robfig/cron/v3@v3.0.0 + +Import it in your program as: + + import "github.com/robfig/cron/v3" + +It requires Go 1.11 or later due to usage of Go Modules. + +Refer to the documentation here: +http://godoc.org/github.com/robfig/cron + +The rest of this document describes the the advances in v3 and a list of +breaking changes for users that wish to upgrade from an earlier version. + +## Upgrading to v3 (June 2019) + +cron v3 is a major upgrade to the library that addresses all outstanding bugs, +feature requests, and rough edges. It is based on a merge of master which +contains various fixes to issues found over the years and the v2 branch which +contains some backwards-incompatible features like the ability to remove cron +jobs. In addition, v3 adds support for Go Modules, cleans up rough edges like +the timezone support, and fixes a number of bugs. + +New features: + +- Support for Go modules. Callers must now import this library as + `github.com/robfig/cron/v3`, instead of `gopkg.in/...` + +- Fixed bugs: + - 0f01e6b parser: fix combining of Dow and Dom (#70) + - dbf3220 adjust times when rolling the clock forward to handle non-existent midnight (#157) + - eeecf15 spec_test.go: ensure an error is returned on 0 increment (#144) + - 70971dc cron.Entries(): update request for snapshot to include a reply channel (#97) + - 1cba5e6 cron: fix: removing a job causes the next scheduled job to run too late (#206) + +- Standard cron spec parsing by default (first field is "minute"), with an easy + way to opt into the seconds field (quartz-compatible). Although, note that the + year field (optional in Quartz) is not supported. + +- Extensible, key/value logging via an interface that complies with + the https://github.com/go-logr/logr project. + +- The new Chain & JobWrapper types allow you to install "interceptors" to add + cross-cutting behavior like the following: + - Recover any panics from jobs + - Delay a job's execution if the previous run hasn't completed yet + - Skip a job's execution if the previous run hasn't completed yet + - Log each job's invocations + - Notification when jobs are completed + +It is backwards incompatible with both v1 and v2. These updates are required: + +- The v1 branch accepted an optional seconds field at the beginning of the cron + spec. This is non-standard and has led to a lot of confusion. The new default + parser conforms to the standard as described by [the Cron wikipedia page]. + + UPDATING: To retain the old behavior, construct your Cron with a custom + parser: + + // Seconds field, required + cron.New(cron.WithSeconds()) + + // Seconds field, optional + cron.New( + cron.WithParser( + cron.SecondOptional | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) + +- The Cron type now accepts functional options on construction rather than the + previous ad-hoc behavior modification mechanisms (setting a field, calling a setter). + + UPDATING: Code that sets Cron.ErrorLogger or calls Cron.SetLocation must be + updated to provide those values on construction. + +- CRON_TZ is now the recommended way to specify the timezone of a single + schedule, which is sanctioned by the specification. The legacy "TZ=" prefix + will continue to be supported since it is unambiguous and easy to do so. + + UPDATING: No update is required. + +- By default, cron will no longer recover panics in jobs that it runs. + Recovering can be surprising (see issue #192) and seems to be at odds with + typical behavior of libraries. Relatedly, the `cron.WithPanicLogger` option + has been removed to accommodate the more general JobWrapper type. + + UPDATING: To opt into panic recovery and configure the panic logger: + + cron.New(cron.WithChain( + cron.Recover(logger), // or use cron.DefaultLogger + )) + +- In adding support for https://github.com/go-logr/logr, `cron.WithVerboseLogger` was + removed, since it is duplicative with the leveled logging. + + UPDATING: Callers should use `WithLogger` and specify a logger that does not + discard `Info` logs. For convenience, one is provided that wraps `*log.Logger`: + + cron.New( + cron.WithLogger(cron.VerbosePrintfLogger(logger))) + + +### Background - Cron spec format + +There are two cron spec formats in common usage: + +- The "standard" cron format, described on [the Cron wikipedia page] and used by + the cron Linux system utility. + +- The cron format used by [the Quartz Scheduler], commonly used for scheduled + jobs in Java software + +[the Cron wikipedia page]: https://en.wikipedia.org/wiki/Cron +[the Quartz Scheduler]: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html + +The original version of this package included an optional "seconds" field, which +made it incompatible with both of these formats. Now, the "standard" format is +the default format accepted, and the Quartz format is opt-in. diff --git a/vendor/github.com/robfig/cron/v3/chain.go b/vendor/github.com/robfig/cron/v3/chain.go new file mode 100644 index 000000000..118e5bbea --- /dev/null +++ b/vendor/github.com/robfig/cron/v3/chain.go @@ -0,0 +1,92 @@ +package cron + +import ( + "fmt" + "runtime" + "sync" + "time" +) + +// JobWrapper decorates the given Job with some behavior. +type JobWrapper func(Job) Job + +// Chain is a sequence of JobWrappers that decorates submitted jobs with +// cross-cutting behaviors like logging or synchronization. +type Chain struct { + wrappers []JobWrapper +} + +// NewChain returns a Chain consisting of the given JobWrappers. +func NewChain(c ...JobWrapper) Chain { + return Chain{c} +} + +// Then decorates the given job with all JobWrappers in the chain. +// +// This: +// NewChain(m1, m2, m3).Then(job) +// is equivalent to: +// m1(m2(m3(job))) +func (c Chain) Then(j Job) Job { + for i := range c.wrappers { + j = c.wrappers[len(c.wrappers)-i-1](j) + } + return j +} + +// Recover panics in wrapped jobs and log them with the provided logger. +func Recover(logger Logger) JobWrapper { + return func(j Job) Job { + return FuncJob(func() { + defer func() { + if r := recover(); r != nil { + const size = 64 << 10 + buf := make([]byte, size) + buf = buf[:runtime.Stack(buf, false)] + err, ok := r.(error) + if !ok { + err = fmt.Errorf("%v", r) + } + logger.Error(err, "panic", "stack", "...\n"+string(buf)) + } + }() + j.Run() + }) + } +} + +// DelayIfStillRunning serializes jobs, delaying subsequent runs until the +// previous one is complete. Jobs running after a delay of more than a minute +// have the delay logged at Info. +func DelayIfStillRunning(logger Logger) JobWrapper { + return func(j Job) Job { + var mu sync.Mutex + return FuncJob(func() { + start := time.Now() + mu.Lock() + defer mu.Unlock() + if dur := time.Since(start); dur > time.Minute { + logger.Info("delay", "duration", dur) + } + j.Run() + }) + } +} + +// SkipIfStillRunning skips an invocation of the Job if a previous invocation is +// still running. It logs skips to the given logger at Info level. +func SkipIfStillRunning(logger Logger) JobWrapper { + var ch = make(chan struct{}, 1) + ch <- struct{}{} + return func(j Job) Job { + return FuncJob(func() { + select { + case v := <-ch: + j.Run() + ch <- v + default: + logger.Info("skip") + } + }) + } +} diff --git a/vendor/gopkg.in/robfig/cron.v2/constantdelay.go b/vendor/github.com/robfig/cron/v3/constantdelay.go similarity index 100% rename from vendor/gopkg.in/robfig/cron.v2/constantdelay.go rename to vendor/github.com/robfig/cron/v3/constantdelay.go diff --git a/vendor/github.com/robfig/cron/v3/cron.go b/vendor/github.com/robfig/cron/v3/cron.go new file mode 100644 index 000000000..f6e451db3 --- /dev/null +++ b/vendor/github.com/robfig/cron/v3/cron.go @@ -0,0 +1,350 @@ +package cron + +import ( + "context" + "sort" + "sync" + "time" +) + +// Cron keeps track of any number of entries, invoking the associated func as +// specified by the schedule. It may be started, stopped, and the entries may +// be inspected while running. +type Cron struct { + entries []*Entry + chain Chain + stop chan struct{} + add chan *Entry + remove chan EntryID + snapshot chan chan []Entry + running bool + logger Logger + runningMu sync.Mutex + location *time.Location + parser Parser + nextID EntryID + jobWaiter sync.WaitGroup +} + +// Job is an interface for submitted cron jobs. +type Job interface { + Run() +} + +// Schedule describes a job's duty cycle. +type Schedule interface { + // Next returns the next activation time, later than the given time. + // Next is invoked initially, and then each time the job is run. + Next(time.Time) time.Time +} + +// EntryID identifies an entry within a Cron instance +type EntryID int + +// Entry consists of a schedule and the func to execute on that schedule. +type Entry struct { + // ID is the cron-assigned ID of this entry, which may be used to look up a + // snapshot or remove it. + ID EntryID + + // Schedule on which this job should be run. + Schedule Schedule + + // Next time the job will run, or the zero time if Cron has not been + // started or this entry's schedule is unsatisfiable + Next time.Time + + // Prev is the last time this job was run, or the zero time if never. + Prev time.Time + + // WrappedJob is the thing to run when the Schedule is activated. + WrappedJob Job + + // Job is the thing that was submitted to cron. + // It is kept around so that user code that needs to get at the job later, + // e.g. via Entries() can do so. + Job Job +} + +// Valid returns true if this is not the zero entry. +func (e Entry) Valid() bool { return e.ID != 0 } + +// byTime is a wrapper for sorting the entry array by time +// (with zero time at the end). +type byTime []*Entry + +func (s byTime) Len() int { return len(s) } +func (s byTime) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s byTime) Less(i, j int) bool { + // Two zero times should return false. + // Otherwise, zero is "greater" than any other time. + // (To sort it at the end of the list.) + if s[i].Next.IsZero() { + return false + } + if s[j].Next.IsZero() { + return true + } + return s[i].Next.Before(s[j].Next) +} + +// New returns a new Cron job runner, modified by the given options. +// +// Available Settings +// +// Time Zone +// Description: The time zone in which schedules are interpreted +// Default: time.Local +// +// Parser +// Description: Parser converts cron spec strings into cron.Schedules. +// Default: Accepts this spec: https://en.wikipedia.org/wiki/Cron +// +// Chain +// Description: Wrap submitted jobs to customize behavior. +// Default: A chain that recovers panics and logs them to stderr. +// +// See "cron.With*" to modify the default behavior. +func New(opts ...Option) *Cron { + c := &Cron{ + entries: nil, + chain: NewChain(), + add: make(chan *Entry), + stop: make(chan struct{}), + snapshot: make(chan chan []Entry), + remove: make(chan EntryID), + running: false, + runningMu: sync.Mutex{}, + logger: DefaultLogger, + location: time.Local, + parser: standardParser, + } + for _, opt := range opts { + opt(c) + } + return c +} + +// FuncJob is a wrapper that turns a func() into a cron.Job +type FuncJob func() + +func (f FuncJob) Run() { f() } + +// AddFunc adds a func to the Cron to be run on the given schedule. +// The spec is parsed using the time zone of this Cron instance as the default. +// An opaque ID is returned that can be used to later remove it. +func (c *Cron) AddFunc(spec string, cmd func()) (EntryID, error) { + return c.AddJob(spec, FuncJob(cmd)) +} + +// AddJob adds a Job to the Cron to be run on the given schedule. +// The spec is parsed using the time zone of this Cron instance as the default. +// An opaque ID is returned that can be used to later remove it. +func (c *Cron) AddJob(spec string, cmd Job) (EntryID, error) { + schedule, err := c.parser.Parse(spec) + if err != nil { + return 0, err + } + return c.Schedule(schedule, cmd), nil +} + +// Schedule adds a Job to the Cron to be run on the given schedule. +// The job is wrapped with the configured Chain. +func (c *Cron) Schedule(schedule Schedule, cmd Job) EntryID { + c.runningMu.Lock() + defer c.runningMu.Unlock() + c.nextID++ + entry := &Entry{ + ID: c.nextID, + Schedule: schedule, + WrappedJob: c.chain.Then(cmd), + Job: cmd, + } + if !c.running { + c.entries = append(c.entries, entry) + } else { + c.add <- entry + } + return entry.ID +} + +// Entries returns a snapshot of the cron entries. +func (c *Cron) Entries() []Entry { + c.runningMu.Lock() + defer c.runningMu.Unlock() + if c.running { + replyChan := make(chan []Entry, 1) + c.snapshot <- replyChan + return <-replyChan + } + return c.entrySnapshot() +} + +// Location gets the time zone location +func (c *Cron) Location() *time.Location { + return c.location +} + +// Entry returns a snapshot of the given entry, or nil if it couldn't be found. +func (c *Cron) Entry(id EntryID) Entry { + for _, entry := range c.Entries() { + if id == entry.ID { + return entry + } + } + return Entry{} +} + +// Remove an entry from being run in the future. +func (c *Cron) Remove(id EntryID) { + c.runningMu.Lock() + defer c.runningMu.Unlock() + if c.running { + c.remove <- id + } else { + c.removeEntry(id) + } +} + +// Start the cron scheduler in its own goroutine, or no-op if already started. +func (c *Cron) Start() { + c.runningMu.Lock() + defer c.runningMu.Unlock() + if c.running { + return + } + c.running = true + go c.run() +} + +// Run the cron scheduler, or no-op if already running. +func (c *Cron) Run() { + c.runningMu.Lock() + if c.running { + c.runningMu.Unlock() + return + } + c.running = true + c.runningMu.Unlock() + c.run() +} + +// run the scheduler.. this is private just due to the need to synchronize +// access to the 'running' state variable. +func (c *Cron) run() { + c.logger.Info("start") + + // Figure out the next activation times for each entry. + now := c.now() + for _, entry := range c.entries { + entry.Next = entry.Schedule.Next(now) + c.logger.Info("schedule", "now", now, "entry", entry.ID, "next", entry.Next) + } + + for { + // Determine the next entry to run. + sort.Sort(byTime(c.entries)) + + var timer *time.Timer + if len(c.entries) == 0 || c.entries[0].Next.IsZero() { + // If there are no entries yet, just sleep - it still handles new entries + // and stop requests. + timer = time.NewTimer(100000 * time.Hour) + } else { + timer = time.NewTimer(c.entries[0].Next.Sub(now)) + } + + for { + select { + case now = <-timer.C: + now = now.In(c.location) + c.logger.Info("wake", "now", now) + + // Run every entry whose next time was less than now + for _, e := range c.entries { + if e.Next.After(now) || e.Next.IsZero() { + break + } + c.startJob(e.WrappedJob) + e.Prev = e.Next + e.Next = e.Schedule.Next(now) + c.logger.Info("run", "now", now, "entry", e.ID, "next", e.Next) + } + + case newEntry := <-c.add: + timer.Stop() + now = c.now() + newEntry.Next = newEntry.Schedule.Next(now) + c.entries = append(c.entries, newEntry) + c.logger.Info("added", "now", now, "entry", newEntry.ID, "next", newEntry.Next) + + case replyChan := <-c.snapshot: + replyChan <- c.entrySnapshot() + continue + + case <-c.stop: + timer.Stop() + c.logger.Info("stop") + return + + case id := <-c.remove: + timer.Stop() + now = c.now() + c.removeEntry(id) + c.logger.Info("removed", "entry", id) + } + + break + } + } +} + +// startJob runs the given job in a new goroutine. +func (c *Cron) startJob(j Job) { + c.jobWaiter.Add(1) + go func() { + defer c.jobWaiter.Done() + j.Run() + }() +} + +// now returns current time in c location +func (c *Cron) now() time.Time { + return time.Now().In(c.location) +} + +// Stop stops the cron scheduler if it is running; otherwise it does nothing. +// A context is returned so the caller can wait for running jobs to complete. +func (c *Cron) Stop() context.Context { + c.runningMu.Lock() + defer c.runningMu.Unlock() + if c.running { + c.stop <- struct{}{} + c.running = false + } + ctx, cancel := context.WithCancel(context.Background()) + go func() { + c.jobWaiter.Wait() + cancel() + }() + return ctx +} + +// entrySnapshot returns a copy of the current cron entry list. +func (c *Cron) entrySnapshot() []Entry { + var entries = make([]Entry, len(c.entries)) + for i, e := range c.entries { + entries[i] = *e + } + return entries +} + +func (c *Cron) removeEntry(id EntryID) { + var entries []*Entry + for _, e := range c.entries { + if e.ID != id { + entries = append(entries, e) + } + } + c.entries = entries +} diff --git a/vendor/gopkg.in/robfig/cron.v2/doc.go b/vendor/github.com/robfig/cron/v3/doc.go similarity index 51% rename from vendor/gopkg.in/robfig/cron.v2/doc.go rename to vendor/github.com/robfig/cron/v3/doc.go index 31cd74a62..ac6b4b078 100644 --- a/vendor/gopkg.in/robfig/cron.v2/doc.go +++ b/vendor/github.com/robfig/cron/v3/doc.go @@ -7,10 +7,11 @@ Callers may register Funcs to be invoked on a given schedule. Cron will run them in their own goroutines. c := cron.New() - c.AddFunc("0 30 * * * *", func() { fmt.Println("Every hour on the half hour") }) - c.AddFunc("TZ=Asia/Tokyo 30 04 * * * *", func() { fmt.Println("Runs at 04:30 Tokyo time every day") }) - c.AddFunc("@hourly", func() { fmt.Println("Every hour") }) - c.AddFunc("@every 1h30m", func() { fmt.Println("Every hour thirty") }) + c.AddFunc("30 * * * *", func() { fmt.Println("Every hour on the half hour") }) + c.AddFunc("30 3-6,20-23 * * *", func() { fmt.Println(".. in the range 3-6am, 8-11pm") }) + c.AddFunc("CRON_TZ=Asia/Tokyo 30 04 * * * *", func() { fmt.Println("Runs at 04:30 Tokyo time every day") }) + c.AddFunc("@hourly", func() { fmt.Println("Every hour, starting an hour from now") }) + c.AddFunc("@every 1h30m", func() { fmt.Println("Every hour thirty, starting an hour thirty from now") }) c.Start() .. // Funcs are invoked in their own goroutine, asynchronously. @@ -25,19 +26,33 @@ them in their own goroutines. CRON Expression Format -A cron expression represents a set of times, using 6 space-separated fields. +A cron expression represents a set of times, using 5 space-separated fields. Field name | Mandatory? | Allowed values | Allowed special characters ---------- | ---------- | -------------- | -------------------------- - Seconds | No | 0-59 | * / , - Minutes | Yes | 0-59 | * / , - Hours | Yes | 0-23 | * / , - Day of month | Yes | 1-31 | * / , - ? Month | Yes | 1-12 or JAN-DEC | * / , - Day of week | Yes | 0-6 or SUN-SAT | * / , - ? -Note: Month and Day-of-week field values are case insensitive. "SUN", "Sun", -and "sun" are equally accepted. +Month and Day-of-week field values are case insensitive. "SUN", "Sun", and +"sun" are equally accepted. + +The specific interpretation of the format is based on the Cron Wikipedia page: +https://en.wikipedia.org/wiki/Cron + +Alternative Formats + +Alternative Cron expression formats support other fields like seconds. You can +implement that by creating a custom Parser as follows. + + cron.New( + cron.WithParser( + cron.SecondOptional | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) + +The most popular alternative Cron expression format is Quartz: +http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html Special Characters @@ -77,24 +92,24 @@ You may use one of several pre-defined schedules in place of a cron expression. Entry | Description | Equivalent To ----- | ----------- | ------------- - @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 * - @monthly | Run once a month, midnight, first of month | 0 0 0 1 * * - @weekly | Run once a week, midnight on Sunday | 0 0 0 * * 0 - @daily (or @midnight) | Run once a day, midnight | 0 0 0 * * * - @hourly | Run once an hour, beginning of hour | 0 0 * * * * + @yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 1 1 * + @monthly | Run once a month, midnight, first of month | 0 0 1 * * + @weekly | Run once a week, midnight between Sat/Sun | 0 0 * * 0 + @daily (or @midnight) | Run once a day, midnight | 0 0 * * * + @hourly | Run once an hour, beginning of hour | 0 * * * * Intervals -You may also schedule a job to execute at fixed intervals. This is supported by -formatting the cron spec like this: +You may also schedule a job to execute at fixed intervals, starting at the time it's added +or cron is run. This is supported by formatting the cron spec like this: @every where "duration" is a string accepted by time.ParseDuration (http://golang.org/pkg/time/#ParseDuration). -For example, "@every 1h30m10s" would indicate a schedule that activates every -1 hour, 30 minutes, 10 seconds. +For example, "@every 1h30m10s" would indicate a schedule that activates after +1 hour, 30 minutes, 10 seconds, and then every interval after that. Note: The interval does not take the job runtime into account. For example, if a job takes 3 minutes to run, and it is scheduled to run every 5 minutes, @@ -103,13 +118,61 @@ it will have only 2 minutes of idle time between each run. Time zones By default, all interpretation and scheduling is done in the machine's local -time zone (as provided by the Go time package http://www.golang.org/pkg/time). -The time zone may be overridden by providing an additional space-separated field -at the beginning of the cron spec, of the form "TZ=Asia/Tokyo" +time zone (time.Local). You can specify a different time zone on construction: + + cron.New( + cron.WithLocation(time.UTC)) + +Individual cron schedules may also override the time zone they are to be +interpreted in by providing an additional space-separated field at the beginning +of the cron spec, of the form "CRON_TZ=Asia/Tokyo". + +For example: + + # Runs at 6am in time.Local + cron.New().AddFunc("0 6 * * ?", ...) + + # Runs at 6am in America/New_York + nyc, _ := time.LoadLocation("America/New_York") + c := cron.New(cron.WithLocation(nyc)) + c.AddFunc("0 6 * * ?", ...) + + # Runs at 6am in Asia/Tokyo + cron.New().AddFunc("CRON_TZ=Asia/Tokyo 0 6 * * ?", ...) + + # Runs at 6am in Asia/Tokyo + c := cron.New(cron.WithLocation(nyc)) + c.SetLocation("America/New_York") + c.AddFunc("CRON_TZ=Asia/Tokyo 0 6 * * ?", ...) + +The prefix "TZ=(TIME ZONE)" is also supported for legacy compatibility. Be aware that jobs scheduled during daylight-savings leap-ahead transitions will not be run! +Job Wrappers / Chain + +A Cron runner may be configured with a chain of job wrappers to add +cross-cutting functionality to all submitted jobs. For example, they may be used +to achieve the following effects: + + - Recover any panics from jobs (activated by default) + - Delay a job's execution if the previous run hasn't completed yet + - Skip a job's execution if the previous run hasn't completed yet + - Log each job's invocations + +Install wrappers for all jobs added to a cron using the `cron.WithChain` option: + + cron.New(cron.WithChain( + cron.SkipIfStillRunning(logger), + )) + +Install wrappers for individual jobs by explicitly wrapping them: + + job = cron.NewChain( + cron.SkipIfStillRunning(logger), + ).Then(job) + Thread safety Since the Cron service runs concurrently with the calling code, some amount of @@ -118,6 +181,23 @@ care must be taken to ensure proper synchronization. All cron methods are designed to be correctly synchronized as long as the caller ensures that invocations have a clear happens-before ordering between them. +Logging + +Cron defines a Logger interface that is a subset of the one defined in +github.com/go-logr/logr. It has two logging levels (Info and Error), and +parameters are key/value pairs. This makes it possible for cron logging to plug +into structured logging systems. An adapter, [Verbose]PrintfLogger, is provided +to wrap the standard library *log.Logger. + +For additional insight into Cron operations, verbose logging may be activated +which will record job runs, scheduling decisions, and added or removed jobs. +Activate it with a one-off logger as follows: + + cron.New( + cron.WithLogger( + cron.VerbosePrintfLogger(log.New(os.Stdout, "cron: ", log.LstdFlags)))) + + Implementation Cron entries are stored in an array, sorted by their next activation time. Cron diff --git a/vendor/github.com/robfig/cron/v3/go.mod b/vendor/github.com/robfig/cron/v3/go.mod new file mode 100644 index 000000000..8c95bf479 --- /dev/null +++ b/vendor/github.com/robfig/cron/v3/go.mod @@ -0,0 +1,3 @@ +module github.com/robfig/cron/v3 + +go 1.12 diff --git a/vendor/github.com/robfig/cron/v3/logger.go b/vendor/github.com/robfig/cron/v3/logger.go new file mode 100644 index 000000000..b4efcc053 --- /dev/null +++ b/vendor/github.com/robfig/cron/v3/logger.go @@ -0,0 +1,86 @@ +package cron + +import ( + "io/ioutil" + "log" + "os" + "strings" + "time" +) + +// DefaultLogger is used by Cron if none is specified. +var DefaultLogger Logger = PrintfLogger(log.New(os.Stdout, "cron: ", log.LstdFlags)) + +// DiscardLogger can be used by callers to discard all log messages. +var DiscardLogger Logger = PrintfLogger(log.New(ioutil.Discard, "", 0)) + +// Logger is the interface used in this package for logging, so that any backend +// can be plugged in. It is a subset of the github.com/go-logr/logr interface. +type Logger interface { + // Info logs routine messages about cron's operation. + Info(msg string, keysAndValues ...interface{}) + // Error logs an error condition. + Error(err error, msg string, keysAndValues ...interface{}) +} + +// PrintfLogger wraps a Printf-based logger (such as the standard library "log") +// into an implementation of the Logger interface which logs errors only. +func PrintfLogger(l interface{ Printf(string, ...interface{}) }) Logger { + return printfLogger{l, false} +} + +// VerbosePrintfLogger wraps a Printf-based logger (such as the standard library +// "log") into an implementation of the Logger interface which logs everything. +func VerbosePrintfLogger(l interface{ Printf(string, ...interface{}) }) Logger { + return printfLogger{l, true} +} + +type printfLogger struct { + logger interface{ Printf(string, ...interface{}) } + logInfo bool +} + +func (pl printfLogger) Info(msg string, keysAndValues ...interface{}) { + if pl.logInfo { + keysAndValues = formatTimes(keysAndValues) + pl.logger.Printf( + formatString(len(keysAndValues)), + append([]interface{}{msg}, keysAndValues...)...) + } +} + +func (pl printfLogger) Error(err error, msg string, keysAndValues ...interface{}) { + keysAndValues = formatTimes(keysAndValues) + pl.logger.Printf( + formatString(len(keysAndValues)+2), + append([]interface{}{msg, "error", err}, keysAndValues...)...) +} + +// formatString returns a logfmt-like format string for the number of +// key/values. +func formatString(numKeysAndValues int) string { + var sb strings.Builder + sb.WriteString("%s") + if numKeysAndValues > 0 { + sb.WriteString(", ") + } + for i := 0; i < numKeysAndValues/2; i++ { + if i > 0 { + sb.WriteString(", ") + } + sb.WriteString("%v=%v") + } + return sb.String() +} + +// formatTimes formats any time.Time values as RFC3339. +func formatTimes(keysAndValues []interface{}) []interface{} { + var formattedArgs []interface{} + for _, arg := range keysAndValues { + if t, ok := arg.(time.Time); ok { + arg = t.Format(time.RFC3339) + } + formattedArgs = append(formattedArgs, arg) + } + return formattedArgs +} diff --git a/vendor/github.com/robfig/cron/v3/option.go b/vendor/github.com/robfig/cron/v3/option.go new file mode 100644 index 000000000..07638201e --- /dev/null +++ b/vendor/github.com/robfig/cron/v3/option.go @@ -0,0 +1,45 @@ +package cron + +import ( + "time" +) + +// Option represents a modification to the default behavior of a Cron. +type Option func(*Cron) + +// WithLocation overrides the timezone of the cron instance. +func WithLocation(loc *time.Location) Option { + return func(c *Cron) { + c.location = loc + } +} + +// WithSeconds overrides the parser used for interpreting job schedules to +// include a seconds field as the first one. +func WithSeconds() Option { + return WithParser(NewParser( + Second | Minute | Hour | Dom | Month | Dow | Descriptor, + )) +} + +// WithParser overrides the parser used for interpreting job schedules. +func WithParser(p Parser) Option { + return func(c *Cron) { + c.parser = p + } +} + +// WithChain specifies Job wrappers to apply to all jobs added to this cron. +// Refer to the Chain* functions in this package for provided wrappers. +func WithChain(wrappers ...JobWrapper) Option { + return func(c *Cron) { + c.chain = NewChain(wrappers...) + } +} + +// WithLogger uses the provided logger. +func WithLogger(logger Logger) Option { + return func(c *Cron) { + c.logger = logger + } +} diff --git a/vendor/github.com/robfig/cron/v3/parser.go b/vendor/github.com/robfig/cron/v3/parser.go new file mode 100644 index 000000000..3cf8879f7 --- /dev/null +++ b/vendor/github.com/robfig/cron/v3/parser.go @@ -0,0 +1,434 @@ +package cron + +import ( + "fmt" + "math" + "strconv" + "strings" + "time" +) + +// Configuration options for creating a parser. Most options specify which +// fields should be included, while others enable features. If a field is not +// included the parser will assume a default value. These options do not change +// the order fields are parse in. +type ParseOption int + +const ( + Second ParseOption = 1 << iota // Seconds field, default 0 + SecondOptional // Optional seconds field, default 0 + Minute // Minutes field, default 0 + Hour // Hours field, default 0 + Dom // Day of month field, default * + Month // Month field, default * + Dow // Day of week field, default * + DowOptional // Optional day of week field, default * + Descriptor // Allow descriptors such as @monthly, @weekly, etc. +) + +var places = []ParseOption{ + Second, + Minute, + Hour, + Dom, + Month, + Dow, +} + +var defaults = []string{ + "0", + "0", + "0", + "*", + "*", + "*", +} + +// A custom Parser that can be configured. +type Parser struct { + options ParseOption +} + +// NewParser creates a Parser with custom options. +// +// It panics if more than one Optional is given, since it would be impossible to +// correctly infer which optional is provided or missing in general. +// +// Examples +// +// // Standard parser without descriptors +// specParser := NewParser(Minute | Hour | Dom | Month | Dow) +// sched, err := specParser.Parse("0 0 15 */3 *") +// +// // Same as above, just excludes time fields +// subsParser := NewParser(Dom | Month | Dow) +// sched, err := specParser.Parse("15 */3 *") +// +// // Same as above, just makes Dow optional +// subsParser := NewParser(Dom | Month | DowOptional) +// sched, err := specParser.Parse("15 */3") +// +func NewParser(options ParseOption) Parser { + optionals := 0 + if options&DowOptional > 0 { + optionals++ + } + if options&SecondOptional > 0 { + optionals++ + } + if optionals > 1 { + panic("multiple optionals may not be configured") + } + return Parser{options} +} + +// Parse returns a new crontab schedule representing the given spec. +// It returns a descriptive error if the spec is not valid. +// It accepts crontab specs and features configured by NewParser. +func (p Parser) Parse(spec string) (Schedule, error) { + if len(spec) == 0 { + return nil, fmt.Errorf("empty spec string") + } + + // Extract timezone if present + var loc = time.Local + if strings.HasPrefix(spec, "TZ=") || strings.HasPrefix(spec, "CRON_TZ=") { + var err error + i := strings.Index(spec, " ") + eq := strings.Index(spec, "=") + if loc, err = time.LoadLocation(spec[eq+1 : i]); err != nil { + return nil, fmt.Errorf("provided bad location %s: %v", spec[eq+1:i], err) + } + spec = strings.TrimSpace(spec[i:]) + } + + // Handle named schedules (descriptors), if configured + if strings.HasPrefix(spec, "@") { + if p.options&Descriptor == 0 { + return nil, fmt.Errorf("parser does not accept descriptors: %v", spec) + } + return parseDescriptor(spec, loc) + } + + // Split on whitespace. + fields := strings.Fields(spec) + + // Validate & fill in any omitted or optional fields + var err error + fields, err = normalizeFields(fields, p.options) + if err != nil { + return nil, err + } + + field := func(field string, r bounds) uint64 { + if err != nil { + return 0 + } + var bits uint64 + bits, err = getField(field, r) + return bits + } + + var ( + second = field(fields[0], seconds) + minute = field(fields[1], minutes) + hour = field(fields[2], hours) + dayofmonth = field(fields[3], dom) + month = field(fields[4], months) + dayofweek = field(fields[5], dow) + ) + if err != nil { + return nil, err + } + + return &SpecSchedule{ + Second: second, + Minute: minute, + Hour: hour, + Dom: dayofmonth, + Month: month, + Dow: dayofweek, + Location: loc, + }, nil +} + +// normalizeFields takes a subset set of the time fields and returns the full set +// with defaults (zeroes) populated for unset fields. +// +// As part of performing this function, it also validates that the provided +// fields are compatible with the configured options. +func normalizeFields(fields []string, options ParseOption) ([]string, error) { + // Validate optionals & add their field to options + optionals := 0 + if options&SecondOptional > 0 { + options |= Second + optionals++ + } + if options&DowOptional > 0 { + options |= Dow + optionals++ + } + if optionals > 1 { + return nil, fmt.Errorf("multiple optionals may not be configured") + } + + // Figure out how many fields we need + max := 0 + for _, place := range places { + if options&place > 0 { + max++ + } + } + min := max - optionals + + // Validate number of fields + if count := len(fields); count < min || count > max { + if min == max { + return nil, fmt.Errorf("expected exactly %d fields, found %d: %s", min, count, fields) + } + return nil, fmt.Errorf("expected %d to %d fields, found %d: %s", min, max, count, fields) + } + + // Populate the optional field if not provided + if min < max && len(fields) == min { + switch { + case options&DowOptional > 0: + fields = append(fields, defaults[5]) // TODO: improve access to default + case options&SecondOptional > 0: + fields = append([]string{defaults[0]}, fields...) + default: + return nil, fmt.Errorf("unknown optional field") + } + } + + // Populate all fields not part of options with their defaults + n := 0 + expandedFields := make([]string, len(places)) + copy(expandedFields, defaults) + for i, place := range places { + if options&place > 0 { + expandedFields[i] = fields[n] + n++ + } + } + return expandedFields, nil +} + +var standardParser = NewParser( + Minute | Hour | Dom | Month | Dow | Descriptor, +) + +// ParseStandard returns a new crontab schedule representing the given +// standardSpec (https://en.wikipedia.org/wiki/Cron). It requires 5 entries +// representing: minute, hour, day of month, month and day of week, in that +// order. It returns a descriptive error if the spec is not valid. +// +// It accepts +// - Standard crontab specs, e.g. "* * * * ?" +// - Descriptors, e.g. "@midnight", "@every 1h30m" +func ParseStandard(standardSpec string) (Schedule, error) { + return standardParser.Parse(standardSpec) +} + +// getField returns an Int with the bits set representing all of the times that +// the field represents or error parsing field value. A "field" is a comma-separated +// list of "ranges". +func getField(field string, r bounds) (uint64, error) { + var bits uint64 + ranges := strings.FieldsFunc(field, func(r rune) bool { return r == ',' }) + for _, expr := range ranges { + bit, err := getRange(expr, r) + if err != nil { + return bits, err + } + bits |= bit + } + return bits, nil +} + +// getRange returns the bits indicated by the given expression: +// number | number "-" number [ "/" number ] +// or error parsing range. +func getRange(expr string, r bounds) (uint64, error) { + var ( + start, end, step uint + rangeAndStep = strings.Split(expr, "/") + lowAndHigh = strings.Split(rangeAndStep[0], "-") + singleDigit = len(lowAndHigh) == 1 + err error + ) + + var extra uint64 + if lowAndHigh[0] == "*" || lowAndHigh[0] == "?" { + start = r.min + end = r.max + extra = starBit + } else { + start, err = parseIntOrName(lowAndHigh[0], r.names) + if err != nil { + return 0, err + } + switch len(lowAndHigh) { + case 1: + end = start + case 2: + end, err = parseIntOrName(lowAndHigh[1], r.names) + if err != nil { + return 0, err + } + default: + return 0, fmt.Errorf("too many hyphens: %s", expr) + } + } + + switch len(rangeAndStep) { + case 1: + step = 1 + case 2: + step, err = mustParseInt(rangeAndStep[1]) + if err != nil { + return 0, err + } + + // Special handling: "N/step" means "N-max/step". + if singleDigit { + end = r.max + } + if step > 1 { + extra = 0 + } + default: + return 0, fmt.Errorf("too many slashes: %s", expr) + } + + if start < r.min { + return 0, fmt.Errorf("beginning of range (%d) below minimum (%d): %s", start, r.min, expr) + } + if end > r.max { + return 0, fmt.Errorf("end of range (%d) above maximum (%d): %s", end, r.max, expr) + } + if start > end { + return 0, fmt.Errorf("beginning of range (%d) beyond end of range (%d): %s", start, end, expr) + } + if step == 0 { + return 0, fmt.Errorf("step of range should be a positive number: %s", expr) + } + + return getBits(start, end, step) | extra, nil +} + +// parseIntOrName returns the (possibly-named) integer contained in expr. +func parseIntOrName(expr string, names map[string]uint) (uint, error) { + if names != nil { + if namedInt, ok := names[strings.ToLower(expr)]; ok { + return namedInt, nil + } + } + return mustParseInt(expr) +} + +// mustParseInt parses the given expression as an int or returns an error. +func mustParseInt(expr string) (uint, error) { + num, err := strconv.Atoi(expr) + if err != nil { + return 0, fmt.Errorf("failed to parse int from %s: %s", expr, err) + } + if num < 0 { + return 0, fmt.Errorf("negative number (%d) not allowed: %s", num, expr) + } + + return uint(num), nil +} + +// getBits sets all bits in the range [min, max], modulo the given step size. +func getBits(min, max, step uint) uint64 { + var bits uint64 + + // If step is 1, use shifts. + if step == 1 { + return ^(math.MaxUint64 << (max + 1)) & (math.MaxUint64 << min) + } + + // Else, use a simple loop. + for i := min; i <= max; i += step { + bits |= 1 << i + } + return bits +} + +// all returns all bits within the given bounds. (plus the star bit) +func all(r bounds) uint64 { + return getBits(r.min, r.max, 1) | starBit +} + +// parseDescriptor returns a predefined schedule for the expression, or error if none matches. +func parseDescriptor(descriptor string, loc *time.Location) (Schedule, error) { + switch descriptor { + case "@yearly", "@annually": + return &SpecSchedule{ + Second: 1 << seconds.min, + Minute: 1 << minutes.min, + Hour: 1 << hours.min, + Dom: 1 << dom.min, + Month: 1 << months.min, + Dow: all(dow), + Location: loc, + }, nil + + case "@monthly": + return &SpecSchedule{ + Second: 1 << seconds.min, + Minute: 1 << minutes.min, + Hour: 1 << hours.min, + Dom: 1 << dom.min, + Month: all(months), + Dow: all(dow), + Location: loc, + }, nil + + case "@weekly": + return &SpecSchedule{ + Second: 1 << seconds.min, + Minute: 1 << minutes.min, + Hour: 1 << hours.min, + Dom: all(dom), + Month: all(months), + Dow: 1 << dow.min, + Location: loc, + }, nil + + case "@daily", "@midnight": + return &SpecSchedule{ + Second: 1 << seconds.min, + Minute: 1 << minutes.min, + Hour: 1 << hours.min, + Dom: all(dom), + Month: all(months), + Dow: all(dow), + Location: loc, + }, nil + + case "@hourly": + return &SpecSchedule{ + Second: 1 << seconds.min, + Minute: 1 << minutes.min, + Hour: all(hours), + Dom: all(dom), + Month: all(months), + Dow: all(dow), + Location: loc, + }, nil + + } + + const every = "@every " + if strings.HasPrefix(descriptor, every) { + duration, err := time.ParseDuration(descriptor[len(every):]) + if err != nil { + return nil, fmt.Errorf("failed to parse duration %s: %s", descriptor, err) + } + return Every(duration), nil + } + + return nil, fmt.Errorf("unrecognized descriptor: %s", descriptor) +} diff --git a/vendor/gopkg.in/robfig/cron.v2/spec.go b/vendor/github.com/robfig/cron/v3/spec.go similarity index 75% rename from vendor/gopkg.in/robfig/cron.v2/spec.go rename to vendor/github.com/robfig/cron/v3/spec.go index 3dfd3e088..fa1e241e5 100644 --- a/vendor/gopkg.in/robfig/cron.v2/spec.go +++ b/vendor/github.com/robfig/cron/v3/spec.go @@ -6,7 +6,9 @@ import "time" // traditional crontab specification. It is computed initially and stored as bit sets. type SpecSchedule struct { Second, Minute, Hour, Dom, Month, Dow uint64 - Location *time.Location + + // Override location for this schedule. + Location *time.Location } // bounds provides a range of acceptable values (plus a map of name to value). @@ -54,7 +56,8 @@ const ( // Next returns the next time this schedule is activated, greater than the given // time. If no time can be found to satisfy the schedule, return the zero time. func (s *SpecSchedule) Next(t time.Time) time.Time { - // General approach: + // General approach + // // For Month, Day, Hour, Minute, Second: // Check if the time value matches. If yes, continue to the next field. // If the field doesn't match the schedule, then increment the field until it matches. @@ -62,10 +65,18 @@ func (s *SpecSchedule) Next(t time.Time) time.Time { // of the field list (since it is necessary to re-verify previous field // values) - // Convert the given time into the schedule's timezone. + // Convert the given time into the schedule's timezone, if one is specified. // Save the original timezone so we can convert back after we find a time. + // Note that schedules without a time zone specified (time.Local) are treated + // as local to the time provided. origLocation := t.Location() - t = t.In(s.Location) + loc := s.Location + if loc == time.Local { + loc = t.Location() + } + if s.Location != time.Local { + t = t.In(s.Location) + } // Start at the earliest possible time (the upcoming second). t = t.Add(1*time.Second - time.Duration(t.Nanosecond())*time.Nanosecond) @@ -88,7 +99,7 @@ WRAP: if !added { added = true // Otherwise, set the date at the beginning (since the current time is irrelevant). - t = time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, s.Location) + t = time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, loc) } t = t.AddDate(0, 1, 0) @@ -99,12 +110,25 @@ WRAP: } // Now get a day in that month. + // + // NOTE: This causes issues for daylight savings regimes where midnight does + // not exist. For example: Sao Paulo has DST that transforms midnight on + // 11/3 into 1am. Handle that by noticing when the Hour ends up != 0. for !dayMatches(s, t) { if !added { added = true - t = time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, s.Location) + t = time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, loc) } t = t.AddDate(0, 0, 1) + // Notice if the hour is no longer midnight due to DST. + // Add an hour if it's 23, subtract an hour if it's 1. + if t.Hour() != 0 { + if t.Hour() > 12 { + t = t.Add(time.Duration(24-t.Hour()) * time.Hour) + } else { + t = t.Add(time.Duration(-t.Hour()) * time.Hour) + } + } if t.Day() == 1 { goto WRAP @@ -114,7 +138,7 @@ WRAP: for 1< 0 dowMatch bool = 1< 0 ) - if s.Dom&starBit > 0 || s.Dow&starBit > 0 { return domMatch && dowMatch } diff --git a/vendor/github.com/spf13/cobra/.gitignore b/vendor/github.com/spf13/cobra/.gitignore index 1b8c7c261..3b053c59e 100644 --- a/vendor/github.com/spf13/cobra/.gitignore +++ b/vendor/github.com/spf13/cobra/.gitignore @@ -34,3 +34,5 @@ tags *.exe cobra.test + +.idea/* diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md index ff16e3f60..60c5a425b 100644 --- a/vendor/github.com/spf13/cobra/README.md +++ b/vendor/github.com/spf13/cobra/README.md @@ -23,6 +23,7 @@ Many of the most widely used Go projects are built using Cobra, such as: [Istio](https://istio.io), [Prototool](https://github.com/uber/prototool), [mattermost-server](https://github.com/mattermost/mattermost-server), +[Gardener](https://github.com/gardener/gardenctl), etc. [![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) @@ -48,6 +49,7 @@ etc. * [Suggestions when "unknown command" happens](#suggestions-when-unknown-command-happens) * [Generating documentation for your command](#generating-documentation-for-your-command) * [Generating bash completions](#generating-bash-completions) + * [Generating zsh completions](#generating-zsh-completions) - [Contributing](#contributing) - [License](#license) @@ -336,7 +338,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out A flag can also be assigned locally which will only apply to that specific command. ```go -rootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") +localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") ``` ### Local Flag on Parent Commands @@ -719,6 +721,11 @@ Cobra can generate documentation based on subcommands, flags, etc. in the follow Cobra can generate a bash-completion file. If you add more information to your command, these completions can be amazingly powerful and flexible. Read more about it in [Bash Completions](bash_completions.md). +## Generating zsh completions + +Cobra can generate zsh-completion file. Read more about it in +[Zsh Completions](zsh_completions.md). + # Contributing 1. Fork it diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go index c3c1e5018..57bb8e1b3 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.go +++ b/vendor/github.com/spf13/cobra/bash_completions.go @@ -545,51 +545,3 @@ func (c *Command) GenBashCompletionFile(filename string) error { return c.GenBashCompletion(outFile) } - -// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, -// and causes your command to report an error if invoked without the flag. -func (c *Command) MarkFlagRequired(name string) error { - return MarkFlagRequired(c.Flags(), name) -} - -// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag if it exists, -// and causes your command to report an error if invoked without the flag. -func (c *Command) MarkPersistentFlagRequired(name string) error { - return MarkFlagRequired(c.PersistentFlags(), name) -} - -// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, -// and causes your command to report an error if invoked without the flag. -func MarkFlagRequired(flags *pflag.FlagSet, name string) error { - return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) -} - -// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists. -// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. -func (c *Command) MarkFlagFilename(name string, extensions ...string) error { - return MarkFlagFilename(c.Flags(), name, extensions...) -} - -// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. -// Generated bash autocompletion will call the bash function f for the flag. -func (c *Command) MarkFlagCustom(name string, f string) error { - return MarkFlagCustom(c.Flags(), name, f) -} - -// MarkPersistentFlagFilename adds the BashCompFilenameExt annotation to the named persistent flag, if it exists. -// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. -func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { - return MarkFlagFilename(c.PersistentFlags(), name, extensions...) -} - -// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists. -// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. -func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { - return flags.SetAnnotation(name, BashCompFilenameExt, extensions) -} - -// MarkFlagCustom adds the BashCompCustom annotation to the named flag in the flag set, if it exists. -// Generated bash autocompletion will call the bash function f for the flag. -func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { - return flags.SetAnnotation(name, BashCompCustom, []string{f}) -} diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go index b257f91b6..c7e898303 100644 --- a/vendor/github.com/spf13/cobra/command.go +++ b/vendor/github.com/spf13/cobra/command.go @@ -177,8 +177,6 @@ type Command struct { // that we can use on every pflag set and children commands globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName - // output is an output writer defined by user. - output io.Writer // usageFunc is usage func defined by user. usageFunc func(*Command) error // usageTemplate is usage template defined by user. @@ -195,6 +193,13 @@ type Command struct { helpCommand *Command // versionTemplate is the version template defined by user. versionTemplate string + + // inReader is a reader defined by the user that replaces stdin + inReader io.Reader + // outWriter is a writer defined by the user that replaces stdout + outWriter io.Writer + // errWriter is a writer defined by the user that replaces stderr + errWriter io.Writer } // SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden @@ -205,8 +210,28 @@ func (c *Command) SetArgs(a []string) { // SetOutput sets the destination for usage and error messages. // If output is nil, os.Stderr is used. +// Deprecated: Use SetOut and/or SetErr instead func (c *Command) SetOutput(output io.Writer) { - c.output = output + c.outWriter = output + c.errWriter = output +} + +// SetOut sets the destination for usage messages. +// If newOut is nil, os.Stdout is used. +func (c *Command) SetOut(newOut io.Writer) { + c.outWriter = newOut +} + +// SetErr sets the destination for error messages. +// If newErr is nil, os.Stderr is used. +func (c *Command) SetErr(newErr io.Writer) { + c.errWriter = newErr +} + +// SetOut sets the source for input data +// If newIn is nil, os.Stdin is used. +func (c *Command) SetIn(newIn io.Reader) { + c.inReader = newIn } // SetUsageFunc sets usage function. Usage can be defined by application. @@ -267,9 +292,19 @@ func (c *Command) OutOrStderr() io.Writer { return c.getOut(os.Stderr) } +// ErrOrStderr returns output to stderr +func (c *Command) ErrOrStderr() io.Writer { + return c.getErr(os.Stderr) +} + +// ErrOrStderr returns output to stderr +func (c *Command) InOrStdin() io.Reader { + return c.getIn(os.Stdin) +} + func (c *Command) getOut(def io.Writer) io.Writer { - if c.output != nil { - return c.output + if c.outWriter != nil { + return c.outWriter } if c.HasParent() { return c.parent.getOut(def) @@ -277,6 +312,26 @@ func (c *Command) getOut(def io.Writer) io.Writer { return def } +func (c *Command) getErr(def io.Writer) io.Writer { + if c.errWriter != nil { + return c.errWriter + } + if c.HasParent() { + return c.parent.getErr(def) + } + return def +} + +func (c *Command) getIn(def io.Reader) io.Reader { + if c.inReader != nil { + return c.inReader + } + if c.HasParent() { + return c.parent.getIn(def) + } + return def +} + // UsageFunc returns either the function set by SetUsageFunc for this command // or a parent, or it returns a default usage function. func (c *Command) UsageFunc() (f func(*Command) error) { @@ -329,13 +384,22 @@ func (c *Command) Help() error { return nil } -// UsageString return usage string. +// UsageString returns usage string. func (c *Command) UsageString() string { - tmpOutput := c.output + // Storing normal writers + tmpOutput := c.outWriter + tmpErr := c.errWriter + bb := new(bytes.Buffer) - c.SetOutput(bb) + c.outWriter = bb + c.errWriter = bb + c.Usage() - c.output = tmpOutput + + // Setting things back to normal + c.outWriter = tmpOutput + c.errWriter = tmpErr + return bb.String() } @@ -1068,6 +1132,21 @@ func (c *Command) Printf(format string, i ...interface{}) { c.Print(fmt.Sprintf(format, i...)) } +// PrintErr is a convenience method to Print to the defined Err output, fallback to Stderr if not set. +func (c *Command) PrintErr(i ...interface{}) { + fmt.Fprint(c.ErrOrStderr(), i...) +} + +// PrintErrln is a convenience method to Println to the defined Err output, fallback to Stderr if not set. +func (c *Command) PrintErrln(i ...interface{}) { + c.Print(fmt.Sprintln(i...)) +} + +// PrintErrf is a convenience method to Printf to the defined Err output, fallback to Stderr if not set. +func (c *Command) PrintErrf(format string, i ...interface{}) { + c.Print(fmt.Sprintf(format, i...)) +} + // CommandPath returns the full path to this command. func (c *Command) CommandPath() string { if c.HasParent() { diff --git a/vendor/github.com/spf13/cobra/powershell_completions.go b/vendor/github.com/spf13/cobra/powershell_completions.go new file mode 100644 index 000000000..756c61b9d --- /dev/null +++ b/vendor/github.com/spf13/cobra/powershell_completions.go @@ -0,0 +1,100 @@ +// PowerShell completions are based on the amazing work from clap: +// https://github.com/clap-rs/clap/blob/3294d18efe5f264d12c9035f404c7d189d4824e1/src/completions/powershell.rs +// +// The generated scripts require PowerShell v5.0+ (which comes Windows 10, but +// can be downloaded separately for windows 7 or 8.1). + +package cobra + +import ( + "bytes" + "fmt" + "io" + "os" + "strings" + + "github.com/spf13/pflag" +) + +var powerShellCompletionTemplate = `using namespace System.Management.Automation +using namespace System.Management.Automation.Language +Register-ArgumentCompleter -Native -CommandName '%s' -ScriptBlock { + param($wordToComplete, $commandAst, $cursorPosition) + $commandElements = $commandAst.CommandElements + $command = @( + '%s' + for ($i = 1; $i -lt $commandElements.Count; $i++) { + $element = $commandElements[$i] + if ($element -isnot [StringConstantExpressionAst] -or + $element.StringConstantType -ne [StringConstantType]::BareWord -or + $element.Value.StartsWith('-')) { + break + } + $element.Value + } + ) -join ';' + $completions = @(switch ($command) {%s + }) + $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | + Sort-Object -Property ListItemText +}` + +func generatePowerShellSubcommandCases(out io.Writer, cmd *Command, previousCommandName string) { + var cmdName string + if previousCommandName == "" { + cmdName = cmd.Name() + } else { + cmdName = fmt.Sprintf("%s;%s", previousCommandName, cmd.Name()) + } + + fmt.Fprintf(out, "\n '%s' {", cmdName) + + cmd.Flags().VisitAll(func(flag *pflag.Flag) { + if nonCompletableFlag(flag) { + return + } + usage := escapeStringForPowerShell(flag.Usage) + if len(flag.Shorthand) > 0 { + fmt.Fprintf(out, "\n [CompletionResult]::new('-%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Shorthand, flag.Shorthand, usage) + } + fmt.Fprintf(out, "\n [CompletionResult]::new('--%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Name, flag.Name, usage) + }) + + for _, subCmd := range cmd.Commands() { + usage := escapeStringForPowerShell(subCmd.Short) + fmt.Fprintf(out, "\n [CompletionResult]::new('%s', '%s', [CompletionResultType]::ParameterValue, '%s')", subCmd.Name(), subCmd.Name(), usage) + } + + fmt.Fprint(out, "\n break\n }") + + for _, subCmd := range cmd.Commands() { + generatePowerShellSubcommandCases(out, subCmd, cmdName) + } +} + +func escapeStringForPowerShell(s string) string { + return strings.Replace(s, "'", "''", -1) +} + +// GenPowerShellCompletion generates PowerShell completion file and writes to the passed writer. +func (c *Command) GenPowerShellCompletion(w io.Writer) error { + buf := new(bytes.Buffer) + + var subCommandCases bytes.Buffer + generatePowerShellSubcommandCases(&subCommandCases, c, "") + fmt.Fprintf(buf, powerShellCompletionTemplate, c.Name(), c.Name(), subCommandCases.String()) + + _, err := buf.WriteTo(w) + return err +} + +// GenPowerShellCompletionFile generates PowerShell completion file. +func (c *Command) GenPowerShellCompletionFile(filename string) error { + outFile, err := os.Create(filename) + if err != nil { + return err + } + defer outFile.Close() + + return c.GenPowerShellCompletion(outFile) +} diff --git a/vendor/github.com/spf13/cobra/powershell_completions.md b/vendor/github.com/spf13/cobra/powershell_completions.md new file mode 100644 index 000000000..afed80240 --- /dev/null +++ b/vendor/github.com/spf13/cobra/powershell_completions.md @@ -0,0 +1,14 @@ +# Generating PowerShell Completions For Your Own cobra.Command + +Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. + +# What's supported + +- Completion for subcommands using their `.Short` description +- Completion for non-hidden flags using their `.Name` and `.Shorthand` + +# What's not yet supported + +- Command aliases +- Required, filename or custom flags (they will work like normal flags) +- Custom completion scripts diff --git a/vendor/github.com/spf13/cobra/shell_completions.go b/vendor/github.com/spf13/cobra/shell_completions.go new file mode 100644 index 000000000..ba0af9cb5 --- /dev/null +++ b/vendor/github.com/spf13/cobra/shell_completions.go @@ -0,0 +1,85 @@ +package cobra + +import ( + "github.com/spf13/pflag" +) + +// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, +// and causes your command to report an error if invoked without the flag. +func (c *Command) MarkFlagRequired(name string) error { + return MarkFlagRequired(c.Flags(), name) +} + +// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag if it exists, +// and causes your command to report an error if invoked without the flag. +func (c *Command) MarkPersistentFlagRequired(name string) error { + return MarkFlagRequired(c.PersistentFlags(), name) +} + +// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists, +// and causes your command to report an error if invoked without the flag. +func MarkFlagRequired(flags *pflag.FlagSet, name string) error { + return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) +} + +// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists. +// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. +func (c *Command) MarkFlagFilename(name string, extensions ...string) error { + return MarkFlagFilename(c.Flags(), name, extensions...) +} + +// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. +// Generated bash autocompletion will call the bash function f for the flag. +func (c *Command) MarkFlagCustom(name string, f string) error { + return MarkFlagCustom(c.Flags(), name, f) +} + +// MarkPersistentFlagFilename instructs the various shell completion +// implementations to limit completions for this persistent flag to the +// specified extensions (patterns). +// +// Shell Completion compatibility matrix: bash, zsh +func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { + return MarkFlagFilename(c.PersistentFlags(), name, extensions...) +} + +// MarkFlagFilename instructs the various shell completion implementations to +// limit completions for this flag to the specified extensions (patterns). +// +// Shell Completion compatibility matrix: bash, zsh +func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { + return flags.SetAnnotation(name, BashCompFilenameExt, extensions) +} + +// MarkFlagCustom instructs the various shell completion implementations to +// limit completions for this flag to the specified extensions (patterns). +// +// Shell Completion compatibility matrix: bash, zsh +func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { + return flags.SetAnnotation(name, BashCompCustom, []string{f}) +} + +// MarkFlagDirname instructs the various shell completion implementations to +// complete only directories with this named flag. +// +// Shell Completion compatibility matrix: zsh +func (c *Command) MarkFlagDirname(name string) error { + return MarkFlagDirname(c.Flags(), name) +} + +// MarkPersistentFlagDirname instructs the various shell completion +// implementations to complete only directories with this persistent named flag. +// +// Shell Completion compatibility matrix: zsh +func (c *Command) MarkPersistentFlagDirname(name string) error { + return MarkFlagDirname(c.PersistentFlags(), name) +} + +// MarkFlagDirname instructs the various shell completion implementations to +// complete only directories with this specified flag. +// +// Shell Completion compatibility matrix: zsh +func MarkFlagDirname(flags *pflag.FlagSet, name string) error { + zshPattern := "-(/)" + return flags.SetAnnotation(name, zshCompDirname, []string{zshPattern}) +} diff --git a/vendor/github.com/spf13/cobra/zsh_completions.go b/vendor/github.com/spf13/cobra/zsh_completions.go index 889c22e27..12755482f 100644 --- a/vendor/github.com/spf13/cobra/zsh_completions.go +++ b/vendor/github.com/spf13/cobra/zsh_completions.go @@ -1,13 +1,102 @@ package cobra import ( - "bytes" + "encoding/json" "fmt" "io" "os" + "sort" "strings" + "text/template" + + "github.com/spf13/pflag" +) + +const ( + zshCompArgumentAnnotation = "cobra_annotations_zsh_completion_argument_annotation" + zshCompArgumentFilenameComp = "cobra_annotations_zsh_completion_argument_file_completion" + zshCompArgumentWordComp = "cobra_annotations_zsh_completion_argument_word_completion" + zshCompDirname = "cobra_annotations_zsh_dirname" +) + +var ( + zshCompFuncMap = template.FuncMap{ + "genZshFuncName": zshCompGenFuncName, + "extractFlags": zshCompExtractFlag, + "genFlagEntryForZshArguments": zshCompGenFlagEntryForArguments, + "extractArgsCompletions": zshCompExtractArgumentCompletionHintsForRendering, + } + zshCompletionText = ` +{{/* should accept Command (that contains subcommands) as parameter */}} +{{define "argumentsC" -}} +{{ $cmdPath := genZshFuncName .}} +function {{$cmdPath}} { + local -a commands + + _arguments -C \{{- range extractFlags .}} + {{genFlagEntryForZshArguments .}} \{{- end}} + "1: :->cmnds" \ + "*::arg:->args" + + case $state in + cmnds) + commands=({{range .Commands}}{{if not .Hidden}} + "{{.Name}}:{{.Short}}"{{end}}{{end}} + ) + _describe "command" commands + ;; + esac + + case "$words[1]" in {{- range .Commands}}{{if not .Hidden}} + {{.Name}}) + {{$cmdPath}}_{{.Name}} + ;;{{end}}{{end}} + esac +} +{{range .Commands}}{{if not .Hidden}} +{{template "selectCmdTemplate" .}} +{{- end}}{{end}} +{{- end}} + +{{/* should accept Command without subcommands as parameter */}} +{{define "arguments" -}} +function {{genZshFuncName .}} { +{{" _arguments"}}{{range extractFlags .}} \ + {{genFlagEntryForZshArguments . -}} +{{end}}{{range extractArgsCompletions .}} \ + {{.}}{{end}} +} +{{end}} + +{{/* dispatcher for commands with or without subcommands */}} +{{define "selectCmdTemplate" -}} +{{if .Hidden}}{{/* ignore hidden*/}}{{else -}} +{{if .Commands}}{{template "argumentsC" .}}{{else}}{{template "arguments" .}}{{end}} +{{- end}} +{{- end}} + +{{/* template entry point */}} +{{define "Main" -}} +#compdef _{{.Name}} {{.Name}} + +{{template "selectCmdTemplate" .}} +{{end}} +` ) +// zshCompArgsAnnotation is used to encode/decode zsh completion for +// arguments to/from Command.Annotations. +type zshCompArgsAnnotation map[int]zshCompArgHint + +type zshCompArgHint struct { + // Indicates the type of the completion to use. One of: + // zshCompArgumentFilenameComp or zshCompArgumentWordComp + Tipe string `json:"type"` + + // A value for the type above (globs for file completion or words) + Options []string `json:"options"` +} + // GenZshCompletionFile generates zsh completion file. func (c *Command) GenZshCompletionFile(filename string) error { outFile, err := os.Create(filename) @@ -19,108 +108,229 @@ func (c *Command) GenZshCompletionFile(filename string) error { return c.GenZshCompletion(outFile) } -// GenZshCompletion generates a zsh completion file and writes to the passed writer. +// GenZshCompletion generates a zsh completion file and writes to the passed +// writer. The completion always run on the root command regardless of the +// command it was called from. func (c *Command) GenZshCompletion(w io.Writer) error { - buf := new(bytes.Buffer) - - writeHeader(buf, c) - maxDepth := maxDepth(c) - writeLevelMapping(buf, maxDepth) - writeLevelCases(buf, maxDepth, c) + tmpl, err := template.New("Main").Funcs(zshCompFuncMap).Parse(zshCompletionText) + if err != nil { + return fmt.Errorf("error creating zsh completion template: %v", err) + } + return tmpl.Execute(w, c.Root()) +} - _, err := buf.WriteTo(w) - return err +// MarkZshCompPositionalArgumentFile marks the specified argument (first +// argument is 1) as completed by file selection. patterns (e.g. "*.txt") are +// optional - if not provided the completion will search for all files. +func (c *Command) MarkZshCompPositionalArgumentFile(argPosition int, patterns ...string) error { + if argPosition < 1 { + return fmt.Errorf("Invalid argument position (%d)", argPosition) + } + annotation, err := c.zshCompGetArgsAnnotations() + if err != nil { + return err + } + if c.zshcompArgsAnnotationnIsDuplicatePosition(annotation, argPosition) { + return fmt.Errorf("Duplicate annotation for positional argument at index %d", argPosition) + } + annotation[argPosition] = zshCompArgHint{ + Tipe: zshCompArgumentFilenameComp, + Options: patterns, + } + return c.zshCompSetArgsAnnotations(annotation) } -func writeHeader(w io.Writer, cmd *Command) { - fmt.Fprintf(w, "#compdef %s\n\n", cmd.Name()) +// MarkZshCompPositionalArgumentWords marks the specified positional argument +// (first argument is 1) as completed by the provided words. At east one word +// must be provided, spaces within words will be offered completion with +// "word\ word". +func (c *Command) MarkZshCompPositionalArgumentWords(argPosition int, words ...string) error { + if argPosition < 1 { + return fmt.Errorf("Invalid argument position (%d)", argPosition) + } + if len(words) == 0 { + return fmt.Errorf("Trying to set empty word list for positional argument %d", argPosition) + } + annotation, err := c.zshCompGetArgsAnnotations() + if err != nil { + return err + } + if c.zshcompArgsAnnotationnIsDuplicatePosition(annotation, argPosition) { + return fmt.Errorf("Duplicate annotation for positional argument at index %d", argPosition) + } + annotation[argPosition] = zshCompArgHint{ + Tipe: zshCompArgumentWordComp, + Options: words, + } + return c.zshCompSetArgsAnnotations(annotation) } -func maxDepth(c *Command) int { - if len(c.Commands()) == 0 { - return 0 +func zshCompExtractArgumentCompletionHintsForRendering(c *Command) ([]string, error) { + var result []string + annotation, err := c.zshCompGetArgsAnnotations() + if err != nil { + return nil, err } - maxDepthSub := 0 - for _, s := range c.Commands() { - subDepth := maxDepth(s) - if subDepth > maxDepthSub { - maxDepthSub = subDepth + for k, v := range annotation { + s, err := zshCompRenderZshCompArgHint(k, v) + if err != nil { + return nil, err } + result = append(result, s) } - return 1 + maxDepthSub + if len(c.ValidArgs) > 0 { + if _, positionOneExists := annotation[1]; !positionOneExists { + s, err := zshCompRenderZshCompArgHint(1, zshCompArgHint{ + Tipe: zshCompArgumentWordComp, + Options: c.ValidArgs, + }) + if err != nil { + return nil, err + } + result = append(result, s) + } + } + sort.Strings(result) + return result, nil } -func writeLevelMapping(w io.Writer, numLevels int) { - fmt.Fprintln(w, `_arguments \`) - for i := 1; i <= numLevels; i++ { - fmt.Fprintf(w, ` '%d: :->level%d' \`, i, i) - fmt.Fprintln(w) +func zshCompRenderZshCompArgHint(i int, z zshCompArgHint) (string, error) { + switch t := z.Tipe; t { + case zshCompArgumentFilenameComp: + var globs []string + for _, g := range z.Options { + globs = append(globs, fmt.Sprintf(`-g "%s"`, g)) + } + return fmt.Sprintf(`'%d: :_files %s'`, i, strings.Join(globs, " ")), nil + case zshCompArgumentWordComp: + var words []string + for _, w := range z.Options { + words = append(words, fmt.Sprintf("%q", w)) + } + return fmt.Sprintf(`'%d: :(%s)'`, i, strings.Join(words, " ")), nil + default: + return "", fmt.Errorf("Invalid zsh argument completion annotation: %s", t) } - fmt.Fprintf(w, ` '%d: :%s'`, numLevels+1, "_files") - fmt.Fprintln(w) } -func writeLevelCases(w io.Writer, maxDepth int, root *Command) { - fmt.Fprintln(w, "case $state in") - defer fmt.Fprintln(w, "esac") +func (c *Command) zshcompArgsAnnotationnIsDuplicatePosition(annotation zshCompArgsAnnotation, position int) bool { + _, dup := annotation[position] + return dup +} - for i := 1; i <= maxDepth; i++ { - fmt.Fprintf(w, " level%d)\n", i) - writeLevel(w, root, i) - fmt.Fprintln(w, " ;;") +func (c *Command) zshCompGetArgsAnnotations() (zshCompArgsAnnotation, error) { + annotation := make(zshCompArgsAnnotation) + annotationString, ok := c.Annotations[zshCompArgumentAnnotation] + if !ok { + return annotation, nil + } + err := json.Unmarshal([]byte(annotationString), &annotation) + if err != nil { + return annotation, fmt.Errorf("Error unmarshaling zsh argument annotation: %v", err) } - fmt.Fprintln(w, " *)") - fmt.Fprintln(w, " _arguments '*: :_files'") - fmt.Fprintln(w, " ;;") + return annotation, nil } -func writeLevel(w io.Writer, root *Command, i int) { - fmt.Fprintf(w, " case $words[%d] in\n", i) - defer fmt.Fprintln(w, " esac") - - commands := filterByLevel(root, i) - byParent := groupByParent(commands) +func (c *Command) zshCompSetArgsAnnotations(annotation zshCompArgsAnnotation) error { + jsn, err := json.Marshal(annotation) + if err != nil { + return fmt.Errorf("Error marshaling zsh argument annotation: %v", err) + } + if c.Annotations == nil { + c.Annotations = make(map[string]string) + } + c.Annotations[zshCompArgumentAnnotation] = string(jsn) + return nil +} - for p, c := range byParent { - names := names(c) - fmt.Fprintf(w, " %s)\n", p) - fmt.Fprintf(w, " _arguments '%d: :(%s)'\n", i, strings.Join(names, " ")) - fmt.Fprintln(w, " ;;") +func zshCompGenFuncName(c *Command) string { + if c.HasParent() { + return zshCompGenFuncName(c.Parent()) + "_" + c.Name() } - fmt.Fprintln(w, " *)") - fmt.Fprintln(w, " _arguments '*: :_files'") - fmt.Fprintln(w, " ;;") + return "_" + c.Name() +} +func zshCompExtractFlag(c *Command) []*pflag.Flag { + var flags []*pflag.Flag + c.LocalFlags().VisitAll(func(f *pflag.Flag) { + if !f.Hidden { + flags = append(flags, f) + } + }) + c.InheritedFlags().VisitAll(func(f *pflag.Flag) { + if !f.Hidden { + flags = append(flags, f) + } + }) + return flags } -func filterByLevel(c *Command, l int) []*Command { - cs := make([]*Command, 0) - if l == 0 { - cs = append(cs, c) - return cs +// zshCompGenFlagEntryForArguments returns an entry that matches _arguments +// zsh-completion parameters. It's too complicated to generate in a template. +func zshCompGenFlagEntryForArguments(f *pflag.Flag) string { + if f.Name == "" || f.Shorthand == "" { + return zshCompGenFlagEntryForSingleOptionFlag(f) } - for _, s := range c.Commands() { - cs = append(cs, filterByLevel(s, l-1)...) + return zshCompGenFlagEntryForMultiOptionFlag(f) +} + +func zshCompGenFlagEntryForSingleOptionFlag(f *pflag.Flag) string { + var option, multiMark, extras string + + if zshCompFlagCouldBeSpecifiedMoreThenOnce(f) { + multiMark = "*" } - return cs + + option = "--" + f.Name + if option == "--" { + option = "-" + f.Shorthand + } + extras = zshCompGenFlagEntryExtras(f) + + return fmt.Sprintf(`'%s%s[%s]%s'`, multiMark, option, zshCompQuoteFlagDescription(f.Usage), extras) } -func groupByParent(commands []*Command) map[string][]*Command { - m := make(map[string][]*Command) - for _, c := range commands { - parent := c.Parent() - if parent == nil { - continue - } - m[parent.Name()] = append(m[parent.Name()], c) +func zshCompGenFlagEntryForMultiOptionFlag(f *pflag.Flag) string { + var options, parenMultiMark, curlyMultiMark, extras string + + if zshCompFlagCouldBeSpecifiedMoreThenOnce(f) { + parenMultiMark = "*" + curlyMultiMark = "\\*" } - return m + + options = fmt.Sprintf(`'(%s-%s %s--%s)'{%s-%s,%s--%s}`, + parenMultiMark, f.Shorthand, parenMultiMark, f.Name, curlyMultiMark, f.Shorthand, curlyMultiMark, f.Name) + extras = zshCompGenFlagEntryExtras(f) + + return fmt.Sprintf(`%s'[%s]%s'`, options, zshCompQuoteFlagDescription(f.Usage), extras) } -func names(commands []*Command) []string { - ns := make([]string, len(commands)) - for i, c := range commands { - ns[i] = c.Name() +func zshCompGenFlagEntryExtras(f *pflag.Flag) string { + if f.NoOptDefVal != "" { + return "" } - return ns + + extras := ":" // allow options for flag (even without assistance) + for key, values := range f.Annotations { + switch key { + case zshCompDirname: + extras = fmt.Sprintf(":filename:_files -g %q", values[0]) + case BashCompFilenameExt: + extras = ":filename:_files" + for _, pattern := range values { + extras = extras + fmt.Sprintf(` -g "%s"`, pattern) + } + } + } + + return extras +} + +func zshCompFlagCouldBeSpecifiedMoreThenOnce(f *pflag.Flag) bool { + return strings.Contains(f.Value.Type(), "Slice") || + strings.Contains(f.Value.Type(), "Array") +} + +func zshCompQuoteFlagDescription(s string) string { + return strings.Replace(s, "'", `'\''`, -1) } diff --git a/vendor/github.com/spf13/cobra/zsh_completions.md b/vendor/github.com/spf13/cobra/zsh_completions.md new file mode 100644 index 000000000..df9c2eac9 --- /dev/null +++ b/vendor/github.com/spf13/cobra/zsh_completions.md @@ -0,0 +1,39 @@ +## Generating Zsh Completion for your cobra.Command + +Cobra supports native Zsh completion generated from the root `cobra.Command`. +The generated completion script should be put somewhere in your `$fpath` named +`_`. + +### What's Supported + +* Completion for all non-hidden subcommands using their `.Short` description. +* Completion for all non-hidden flags using the following rules: + * Filename completion works by marking the flag with `cmd.MarkFlagFilename...` + family of commands. + * The requirement for argument to the flag is decided by the `.NoOptDefVal` + flag value - if it's empty then completion will expect an argument. + * Flags of one of the various `*Array` and `*Slice` types supports multiple + specifications (with or without argument depending on the specific type). +* Completion of positional arguments using the following rules: + * Argument position for all options below starts at `1`. If argument position + `0` is requested it will raise an error. + * Use `command.MarkZshCompPositionalArgumentFile` to complete filenames. Glob + patterns (e.g. `"*.log"`) are optional - if not specified it will offer to + complete all file types. + * Use `command.MarkZshCompPositionalArgumentWords` to offer specific words for + completion. At least one word is required. + * It's possible to specify completion for some arguments and leave some + unspecified (e.g. offer words for second argument but nothing for first + argument). This will cause no completion for first argument but words + completion for second argument. + * If no argument completion was specified for 1st argument (but optionally was + specified for 2nd) and the command has `ValidArgs` it will be used as + completion options for 1st argument. + * Argument completions only offered for commands with no subcommands. + +### What's not yet Supported + +* Custom completion scripts are not supported yet (We should probably create zsh + specific one, doesn't make sense to re-use the bash one as the functions will + be different). +* Whatever other feature you're looking for and doesn't exist :) diff --git a/vendor/go.opencensus.io/README.md b/vendor/go.opencensus.io/README.md index 3f40ed5cb..fabab2e06 100644 --- a/vendor/go.opencensus.io/README.md +++ b/vendor/go.opencensus.io/README.md @@ -253,10 +253,10 @@ release in which the functionality was marked *Deprecated*. [new-ex]: https://godoc.org/go.opencensus.io/tag#example-NewMap [new-replace-ex]: https://godoc.org/go.opencensus.io/tag#example-NewMap--Replace -[exporter-prom]: https://godoc.org/go.opencensus.io/exporter/prometheus +[exporter-prom]: https://godoc.org/contrib.go.opencensus.io/exporter/prometheus [exporter-stackdriver]: https://godoc.org/contrib.go.opencensus.io/exporter/stackdriver -[exporter-zipkin]: https://godoc.org/go.opencensus.io/exporter/zipkin -[exporter-jaeger]: https://godoc.org/go.opencensus.io/exporter/jaeger +[exporter-zipkin]: https://godoc.org/contrib.go.opencensus.io/exporter/zipkin +[exporter-jaeger]: https://godoc.org/contrib.go.opencensus.io/exporter/jaeger [exporter-xray]: https://github.com/census-ecosystem/opencensus-go-exporter-aws [exporter-datadog]: https://github.com/DataDog/opencensus-go-exporter-datadog [exporter-graphite]: https://github.com/census-ecosystem/opencensus-go-exporter-graphite diff --git a/vendor/go.opencensus.io/go.mod b/vendor/go.opencensus.io/go.mod index 8b7d38e91..cb4de80f3 100644 --- a/vendor/go.opencensus.io/go.mod +++ b/vendor/go.opencensus.io/go.mod @@ -1,10 +1,12 @@ module go.opencensus.io require ( - github.com/golang/protobuf v1.2.0 - github.com/google/go-cmp v0.2.0 - github.com/hashicorp/golang-lru v0.5.0 - golang.org/x/net v0.0.0-20190311183353-d8887717615a - google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 // indirect - google.golang.org/grpc v1.19.0 + github.com/golang/protobuf v1.3.1 + github.com/google/go-cmp v0.3.0 + github.com/hashicorp/golang-lru v0.5.1 + golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09 + golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd // indirect + golang.org/x/text v0.3.2 // indirect + google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect + google.golang.org/grpc v1.20.1 ) diff --git a/vendor/go.opencensus.io/go.sum b/vendor/go.opencensus.io/go.sum index cbb37036d..0b948c2b4 100644 --- a/vendor/go.opencensus.io/go.sum +++ b/vendor/go.opencensus.io/go.sum @@ -6,21 +6,24 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09 h1:KaQtG+aDELoNmXYas3TVkGNYRuq8JQ1aa7LJt8EXVyo= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -31,20 +34,28 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd h1:r7DufRZuZbWB7j439YfAzP8RPDa9unLkpwQKUYbIMPI= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb h1:i1Ppqkc3WQXikh8bXiwHqAN5Rv3/qDCcRk0/Otx73BY= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/go.opencensus.io/opencensus.go b/vendor/go.opencensus.io/opencensus.go index d2565f1e2..626d73645 100644 --- a/vendor/go.opencensus.io/opencensus.go +++ b/vendor/go.opencensus.io/opencensus.go @@ -17,5 +17,5 @@ package opencensus // import "go.opencensus.io" // Version is the current release version of OpenCensus in use. func Version() string { - return "0.21.0" + return "0.22.0" } diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client.go b/vendor/go.opencensus.io/plugin/ocgrpc/client.go index a6c466ae8..28fddb844 100644 --- a/vendor/go.opencensus.io/plugin/ocgrpc/client.go +++ b/vendor/go.opencensus.io/plugin/ocgrpc/client.go @@ -15,8 +15,8 @@ package ocgrpc import ( + "context" "go.opencensus.io/trace" - "golang.org/x/net/context" "google.golang.org/grpc/stats" ) diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go b/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go index 303c607f6..18821c7f5 100644 --- a/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go +++ b/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go @@ -18,8 +18,8 @@ package ocgrpc import ( "time" + "context" "go.opencensus.io/tag" - "golang.org/x/net/context" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/stats" ) diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server.go b/vendor/go.opencensus.io/plugin/ocgrpc/server.go index b67b3e2be..15ada839d 100644 --- a/vendor/go.opencensus.io/plugin/ocgrpc/server.go +++ b/vendor/go.opencensus.io/plugin/ocgrpc/server.go @@ -15,8 +15,8 @@ package ocgrpc import ( + "context" "go.opencensus.io/trace" - "golang.org/x/net/context" "google.golang.org/grpc/stats" ) diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go b/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go index 7847c1a91..afcef023a 100644 --- a/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go +++ b/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go @@ -18,7 +18,7 @@ package ocgrpc import ( "time" - "golang.org/x/net/context" + "context" "go.opencensus.io/tag" "google.golang.org/grpc/grpclog" diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go b/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go index 720f381c2..fef582756 100644 --- a/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go +++ b/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go @@ -19,9 +19,9 @@ import ( "google.golang.org/grpc/codes" + "context" "go.opencensus.io/trace" "go.opencensus.io/trace/propagation" - "golang.org/x/net/context" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" diff --git a/vendor/go.opencensus.io/stats/view/view_to_metric.go b/vendor/go.opencensus.io/stats/view/view_to_metric.go index 010f81bab..f67b5c464 100644 --- a/vendor/go.opencensus.io/stats/view/view_to_metric.go +++ b/vendor/go.opencensus.io/stats/view/view_to_metric.go @@ -73,7 +73,7 @@ func getType(v *View) metricdata.Type { } } -func getLableKeys(v *View) []metricdata.LabelKey { +func getLabelKeys(v *View) []metricdata.LabelKey { labelKeys := []metricdata.LabelKey{} for _, k := range v.TagKeys { labelKeys = append(labelKeys, metricdata.LabelKey{Key: k.Name()}) @@ -87,7 +87,7 @@ func viewToMetricDescriptor(v *View) *metricdata.Descriptor { Description: v.Description, Unit: getUnit(v.Measure.Unit()), Type: getType(v), - LabelKeys: getLableKeys(v), + LabelKeys: getLabelKeys(v), } } diff --git a/vendor/go.opencensus.io/tag/key.go b/vendor/go.opencensus.io/tag/key.go index ebbed9500..4e63d08c9 100644 --- a/vendor/go.opencensus.io/tag/key.go +++ b/vendor/go.opencensus.io/tag/key.go @@ -29,6 +29,16 @@ func NewKey(name string) (Key, error) { return Key{name: name}, nil } +// MustNewKey creates or retrieves a string key identified by name. +// An invalid key name raises a panic. +func MustNewKey(name string) Key { + k, err := NewKey(name) + if err != nil { + panic(err) + } + return k +} + // Name returns the name of the key. func (k Key) Name() string { return k.name diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index d4abeb2b9..57334dc79 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -273,7 +273,20 @@ func ConfigureServer(s *http.Server, conf *Server) error { if testHookOnConn != nil { testHookOnConn() } + // The TLSNextProto interface predates contexts, so + // the net/http package passes down its per-connection + // base context via an exported but unadvertised + // method on the Handler. This is for internal + // net/http<=>http2 use only. + var ctx context.Context + type baseContexter interface { + BaseContext() context.Context + } + if bc, ok := h.(baseContexter); ok { + ctx = bc.BaseContext() + } conf.ServeConn(c, &ServeConnOpts{ + Context: ctx, Handler: h, BaseConfig: hs, }) @@ -284,6 +297,10 @@ func ConfigureServer(s *http.Server, conf *Server) error { // ServeConnOpts are options for the Server.ServeConn method. type ServeConnOpts struct { + // Context is the base context to use. + // If nil, context.Background is used. + Context context.Context + // BaseConfig optionally sets the base configuration // for values. If nil, defaults are used. BaseConfig *http.Server @@ -294,6 +311,13 @@ type ServeConnOpts struct { Handler http.Handler } +func (o *ServeConnOpts) context() context.Context { + if o.Context != nil { + return o.Context + } + return context.Background() +} + func (o *ServeConnOpts) baseConfig() *http.Server { if o != nil && o.BaseConfig != nil { return o.BaseConfig @@ -439,7 +463,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { } func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx context.Context, cancel func()) { - ctx, cancel = context.WithCancel(context.Background()) + ctx, cancel = context.WithCancel(opts.context()) ctx = context.WithValue(ctx, http.LocalAddrContextKey, c.LocalAddr()) if hs := opts.baseConfig(); hs != nil { ctx = context.WithValue(ctx, http.ServerContextKey, hs) diff --git a/vendor/golang.org/x/oauth2/google/google.go b/vendor/golang.org/x/oauth2/google/google.go index 6eb2aa95f..81de32b36 100644 --- a/vendor/golang.org/x/oauth2/google/google.go +++ b/vendor/golang.org/x/oauth2/google/google.go @@ -194,9 +194,16 @@ func (cs computeSource) Token() (*oauth2.Token, error) { if res.ExpiresInSec == 0 || res.AccessToken == "" { return nil, fmt.Errorf("oauth2/google: incomplete token received from metadata") } - return &oauth2.Token{ + tok := &oauth2.Token{ AccessToken: res.AccessToken, TokenType: res.TokenType, Expiry: time.Now().Add(time.Duration(res.ExpiresInSec) * time.Second), - }, nil + } + // NOTE(cbro): add hidden metadata about where the token is from. + // This is needed for detection by client libraries to know that credentials come from the metadata server. + // This may be removed in a future version of this library. + return tok.WithExtra(map[string]interface{}{ + "oauth2.google.tokenSource": "compute-metadata", + "oauth2.google.serviceAccount": acct, + }), nil } diff --git a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s new file mode 100644 index 000000000..6db717de5 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s @@ -0,0 +1,54 @@ +// 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. + +// +build riscv64,!gccgo + +#include "textflag.h" + +// +// System calls for linux/riscv64. +// +// Where available, just jump to package syscall's implementation of +// these functions. + +TEXT ·Syscall(SB),NOSPLIT,$0-56 + JMP syscall·Syscall(SB) + +TEXT ·Syscall6(SB),NOSPLIT,$0-80 + JMP syscall·Syscall6(SB) + +TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 + CALL runtime·entersyscall(SB) + MOV a1+8(FP), A0 + MOV a2+16(FP), A1 + MOV a3+24(FP), A2 + MOV $0, A3 + MOV $0, A4 + MOV $0, A5 + MOV $0, A6 + MOV trap+0(FP), A7 // syscall entry + ECALL + MOV A0, r1+32(FP) // r1 + MOV A1, r2+40(FP) // r2 + CALL runtime·exitsyscall(SB) + RET + +TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + JMP syscall·RawSyscall(SB) + +TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + JMP syscall·RawSyscall6(SB) + +TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 + MOV a1+8(FP), A0 + MOV a2+16(FP), A1 + MOV a3+24(FP), A2 + MOV ZERO, A3 + MOV ZERO, A4 + MOV ZERO, A5 + MOV trap+0(FP), A7 // syscall entry + ECALL + MOV A0, r1+32(FP) + MOV A1, r2+40(FP) + RET diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index 80d00707b..5a22eca96 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -105,25 +105,25 @@ dragonfly_amd64) freebsd_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" + mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_amd64) mkerrors="$mkerrors -m64" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" + mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_arm) mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32 -arm" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" + mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; freebsd_arm64) mkerrors="$mkerrors -m64" - mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" + mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_386) diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 82979b3cf..3d85f2795 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -183,6 +183,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -434,7 +435,7 @@ ccflags="$@" $2 ~ /^TC[IO](ON|OFF)$/ || $2 ~ /^IN_/ || $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || $2 ~ /^TP_STATUS_/ || $2 ~ /^FALLOC_/ || $2 == "ICMPV6_FILTER" || diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go index 4d5b531b5..eb4332059 100644 --- a/vendor/golang.org/x/sys/unix/mkpost.go +++ b/vendor/golang.org/x/sys/unix/mkpost.go @@ -50,8 +50,8 @@ func main() { } // Intentionally export __val fields in Fsid and Sigset_t - valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`) - b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}")) + valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`) + b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}")) // Intentionally export __fds_bits field in FdSet fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`) diff --git a/vendor/golang.org/x/sys/unix/mksysnum.go b/vendor/golang.org/x/sys/unix/mksysnum.go index 07f8960ff..baa6ecd85 100644 --- a/vendor/golang.org/x/sys/unix/mksysnum.go +++ b/vendor/golang.org/x/sys/unix/mksysnum.go @@ -139,7 +139,7 @@ func main() { text += format(name, num, proto) } case "freebsd": - if t.Match(`^([0-9]+)\s+\S+\s+(?:NO)?STD\s+({ \S+\s+(\w+).*)$`) { + if t.Match(`^([0-9]+)\s+\S+\s+(?:(?:NO)?STD|COMPAT10)\s+({ \S+\s+(\w+).*)$`) { num, proto := t.sub[1], t.sub[2] name := fmt.Sprintf("SYS_%s", t.sub[3]) text += format(name, num, proto) diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdents.go b/vendor/golang.org/x/sys/unix/readdirent_getdents.go new file mode 100644 index 000000000..3a90aa6df --- /dev/null +++ b/vendor/golang.org/x/sys/unix/readdirent_getdents.go @@ -0,0 +1,12 @@ +// 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. + +// +build aix dragonfly freebsd linux netbsd openbsd + +package unix + +// ReadDirent reads directory entries from fd and writes them into buf. +func ReadDirent(fd int, buf []byte) (n int, err error) { + return Getdents(fd, buf) +} diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go new file mode 100644 index 000000000..5fdae40b3 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go @@ -0,0 +1,19 @@ +// 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. + +// +build darwin + +package unix + +import "unsafe" + +// ReadDirent reads directory entries from fd and writes them into buf. +func ReadDirent(fd int, buf []byte) (n int, err error) { + // Final argument is (basep *uintptr) and the syscall doesn't take nil. + // 64 bits should be enough. (32 bits isn't even on 386). Since the + // actual system call is getdirentries64, 64 is a good guess. + // TODO(rsc): Can we use a single global basep for all calls? + var base = (*uintptr)(unsafe.Pointer(new(uint64))) + return Getdirentries(fd, buf, base) +} diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go index 45e12fb8a..a079243dc 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -281,7 +281,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } //sys getdirent(fd int, buf []byte) (n int, err error) -func ReadDirent(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { return getdirent(fd, buf) } diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index 33c8b5f0d..97a8eef6f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -63,15 +63,6 @@ func Setgroups(gids []int) (err error) { return setgroups(len(a), &a[0]) } -func ReadDirent(fd int, buf []byte) (n int, err error) { - // Final argument is (basep *uintptr) and the syscall doesn't take nil. - // 64 bits should be enough. (32 bits isn't even on 386). Since the - // actual system call is getdirentries64, 64 is a good guess. - // TODO(rsc): Can we use a single global basep for all calls? - var base = (*uintptr)(unsafe.Pointer(new(uint64))) - return Getdirentries(fd, buf, base) -} - // Wait status is 7 bits at bottom, either 0 (exited), // 0x7F (stopped), or a signal number that caused an exit. // The 0x80 bit is whether there was a core dump. @@ -86,6 +77,7 @@ const ( shift = 8 exited = 0 + killed = 9 stopped = 0x7F ) @@ -112,6 +104,8 @@ func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } func (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP } +func (w WaitStatus) Killed() bool { return w&mask == killed && syscall.Signal(w>>shift) != SIGKILL } + func (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP } func (w WaitStatus) StopSignal() syscall.Signal { diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index 962eee304..bf537011f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -269,6 +269,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) +//sys Getdents(fd int, buf []byte) (n int, err error) //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go index f135812a3..c9c802df0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -362,7 +362,21 @@ func Getdents(fd int, buf []byte) (n int, err error) { func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { if supportsABI(_ino64First) { - return getdirentries_freebsd12(fd, buf, basep) + if basep == nil || unsafe.Sizeof(*basep) == 8 { + return getdirentries_freebsd12(fd, buf, (*uint64)(unsafe.Pointer(basep))) + } + // The freebsd12 syscall needs a 64-bit base. On 32-bit machines + // we can't just use the basep passed in. See #32498. + var base uint64 = uint64(*basep) + n, err = getdirentries_freebsd12(fd, buf, &base) + *basep = uintptr(base) + if base>>32 != 0 { + // We can't stuff the base back into a uintptr, so any + // future calls would be suspect. Generate an error. + // EIO is allowed by getdirentries. + err = EIO + } + return } // The old syscall entries are smaller than the new. Use 1/4 of the original @@ -507,6 +521,70 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e return sendfile(outfd, infd, offset, count) } +//sys ptrace(request int, pid int, addr uintptr, data int) (err error) + +func PtraceAttach(pid int) (err error) { + return ptrace(PTRACE_ATTACH, pid, 0, 0) +} + +func PtraceCont(pid int, signal int) (err error) { + return ptrace(PTRACE_CONT, pid, 1, signal) +} + +func PtraceDetach(pid int) (err error) { + return ptrace(PTRACE_DETACH, pid, 1, 0) +} + +func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) { + return ptrace(PTRACE_GETFPREGS, pid, uintptr(unsafe.Pointer(fpregsout)), 0) +} + +func PtraceGetFsBase(pid int, fsbase *int64) (err error) { + return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0) +} + +func PtraceGetRegs(pid int, regsout *Reg) (err error) { + return ptrace(PTRACE_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0) +} + +func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { + ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint(countin)} + err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) + return int(ioDesc.Len), err +} + +func PtraceLwpEvents(pid int, enable int) (err error) { + return ptrace(PTRACE_LWPEVENTS, pid, 0, enable) +} + +func PtraceLwpInfo(pid int, info uintptr) (err error) { + return ptrace(PTRACE_LWPINFO, pid, info, int(unsafe.Sizeof(PtraceLwpInfoStruct{}))) +} + +func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) { + return PtraceIO(PIOD_READ_D, pid, addr, out, SizeofLong) +} + +func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) { + return PtraceIO(PIOD_READ_I, pid, addr, out, SizeofLong) +} + +func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) { + return PtraceIO(PIOD_WRITE_D, pid, addr, data, SizeofLong) +} + +func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) { + return PtraceIO(PIOD_WRITE_I, pid, addr, data, SizeofLong) +} + +func PtraceSetRegs(pid int, regs *Reg) (err error) { + return ptrace(PTRACE_SETREGS, pid, uintptr(unsafe.Pointer(regs)), 0) +} + +func PtraceSingleStep(pid int) (err error) { + return ptrace(PTRACE_SINGLESTEP, pid, 1, 0) +} + /* * Exposed directly */ @@ -555,7 +633,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sys getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) -//sys getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) +//sys getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index d7a8f7317..11d07ace2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -13,7 +13,6 @@ package unix import ( "encoding/binary" - "net" "runtime" "syscall" "unsafe" @@ -765,7 +764,7 @@ const px_proto_oe = 0 type SockaddrPPPoE struct { SID uint16 - Remote net.HardwareAddr + Remote []byte Dev string raw RawSockaddrPPPoX } @@ -916,7 +915,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { } sa := &SockaddrPPPoE{ SID: binary.BigEndian.Uint16(pp[6:8]), - Remote: net.HardwareAddr(pp[8:14]), + Remote: pp[8:14], } for i := 14; i < 14+IFNAMSIZ; i++ { if pp[i] == 0 { @@ -1414,10 +1413,6 @@ func Reboot(cmd int) (err error) { return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "") } -func ReadDirent(fd int, buf []byte) (n int, err error) { - return Getdents(fd, buf) -} - //sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { @@ -1450,6 +1445,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Acct(path string) (err error) //sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) //sys Adjtimex(buf *Timex) (state int, err error) +//sys Capget(hdr *CapUserHeader, data *CapUserData) (err error) +//sys Capset(hdr *CapUserHeader, data *CapUserData) (err error) //sys Chdir(path string) (err error) //sys Chroot(path string) (err error) //sys ClockGetres(clockid int32, res *Timespec) (err error) @@ -1537,9 +1534,13 @@ func Setgid(uid int) (err error) { return EOPNOTSUPP } +func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { + return signalfd(fd, sigmask, _C__NSIG/8, flags) +} + //sys Setpriority(which int, who int, prio int) (err error) //sys Setxattr(path string, attr string, data []byte, flags int) (err error) -//sys Signalfd(fd int, mask *Sigset_t, flags int) = SYS_SIGNALFD4 +//sys signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) = SYS_SIGNALFD4 //sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) //sys Sync() //sys Syncfs(fd int) (err error) @@ -1751,8 +1752,6 @@ func OpenByHandleAt(mountFD int, handle FileHandle, flags int) (fd int, err erro // Alarm // ArchPrctl // Brk -// Capget -// Capset // ClockNanosleep // ClockSettime // Clone diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 5240e16e4..45377107a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -120,9 +120,30 @@ func Pipe(p []int) (err error) { return } -//sys getdents(fd int, buf []byte) (n int, err error) +//sys Getdents(fd int, buf []byte) (n int, err error) func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - return getdents(fd, buf) + n, err = Getdents(fd, buf) + if err != nil || basep == nil { + return + } + + var off int64 + off, err = Seek(fd, 0, 1 /* SEEK_CUR */) + if err != nil { + *basep = ^uintptr(0) + return + } + *basep = uintptr(off) + if unsafe.Sizeof(*basep) == 8 { + return + } + if off>>32 != 0 { + // We can't stuff the offset back into a uintptr, so any + // future calls would be suspect. Generate an error. + // EIO is allowed by getdirentries. + err = EIO + } + return } const ImplementsGetwd = true diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index c8648ec02..4f34d6d03 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -89,9 +89,30 @@ func Pipe(p []int) (err error) { return } -//sys getdents(fd int, buf []byte) (n int, err error) +//sys Getdents(fd int, buf []byte) (n int, err error) func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - return getdents(fd, buf) + n, err = Getdents(fd, buf) + if err != nil || basep == nil { + return + } + + var off int64 + off, err = Seek(fd, 0, 1 /* SEEK_CUR */) + if err != nil { + *basep = ^uintptr(0) + return + } + *basep = uintptr(off) + if unsafe.Sizeof(*basep) == 8 { + return + } + if off>>32 != 0 { + // We can't stuff the offset back into a uintptr, so any + // future calls would be suspect. Generate an error. + // EIO was allowed by getdirentries. + err = EIO + } + return } const ImplementsGetwd = true diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index e47801275..9147ba152 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -189,6 +189,7 @@ func Setgroups(gids []int) (err error) { return setgroups(len(a), &a[0]) } +// ReadDirent reads directory entries from fd and writes them into buf. func ReadDirent(fd int, buf []byte) (n int, err error) { // Final argument is (basep *uintptr) and the syscall doesn't take nil. // TODO(rsc): Can we use a single global basep for all calls? diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go index 747079895..a121dc336 100644 --- a/vendor/golang.org/x/sys/unix/types_freebsd.go +++ b/vendor/golang.org/x/sys/unix/types_freebsd.go @@ -243,11 +243,55 @@ const ( // Ptrace requests const ( - PTRACE_TRACEME = C.PT_TRACE_ME - PTRACE_CONT = C.PT_CONTINUE - PTRACE_KILL = C.PT_KILL + PTRACE_ATTACH = C.PT_ATTACH + PTRACE_CONT = C.PT_CONTINUE + PTRACE_DETACH = C.PT_DETACH + PTRACE_GETFPREGS = C.PT_GETFPREGS + PTRACE_GETFSBASE = C.PT_GETFSBASE + PTRACE_GETLWPLIST = C.PT_GETLWPLIST + PTRACE_GETNUMLWPS = C.PT_GETNUMLWPS + PTRACE_GETREGS = C.PT_GETREGS + PTRACE_GETXSTATE = C.PT_GETXSTATE + PTRACE_IO = C.PT_IO + PTRACE_KILL = C.PT_KILL + PTRACE_LWPEVENTS = C.PT_LWP_EVENTS + PTRACE_LWPINFO = C.PT_LWPINFO + PTRACE_SETFPREGS = C.PT_SETFPREGS + PTRACE_SETREGS = C.PT_SETREGS + PTRACE_SINGLESTEP = C.PT_STEP + PTRACE_TRACEME = C.PT_TRACE_ME ) +const ( + PIOD_READ_D = C.PIOD_READ_D + PIOD_WRITE_D = C.PIOD_WRITE_D + PIOD_READ_I = C.PIOD_READ_I + PIOD_WRITE_I = C.PIOD_WRITE_I +) + +const ( + PL_FLAG_BORN = C.PL_FLAG_BORN + PL_FLAG_EXITED = C.PL_FLAG_EXITED + PL_FLAG_SI = C.PL_FLAG_SI +) + +const ( + TRAP_BRKPT = C.TRAP_BRKPT + TRAP_TRACE = C.TRAP_TRACE +) + +type PtraceLwpInfoStruct C.struct_ptrace_lwpinfo + +type __Siginfo C.struct___siginfo + +type Sigset_t C.sigset_t + +type Reg C.struct_reg + +type FpReg C.struct_fpreg + +type PtraceIoDesc C.struct_ptrace_io_desc + // Events (kqueue, kevent) type Kevent_t C.struct_kevent_freebsd11 diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go index 2dd4f9542..4a96d72c3 100644 --- a/vendor/golang.org/x/sys/unix/types_netbsd.go +++ b/vendor/golang.org/x/sys/unix/types_netbsd.go @@ -254,6 +254,7 @@ type Ptmget C.struct_ptmget const ( AT_FDCWD = C.AT_FDCWD + AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW ) diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go index 8aafbe446..775cb57dc 100644 --- a/vendor/golang.org/x/sys/unix/types_openbsd.go +++ b/vendor/golang.org/x/sys/unix/types_openbsd.go @@ -241,6 +241,7 @@ type Winsize C.struct_winsize const ( AT_FDCWD = C.AT_FDCWD + AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW ) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index cd117521d..1db2f00de 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1134,6 +1175,15 @@ const ( MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index c1c0e9cb4..8a9d2eadf 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1134,6 +1175,15 @@ const ( MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 513cdbadb..2e7455814 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1132,6 +1173,15 @@ const ( MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 4573ca837..b1dc633a2 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1135,6 +1176,15 @@ const ( MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 3ce8a9cd1..ad4d9afb6 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1132,6 +1173,15 @@ const ( MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 9a00a9d5e..fe2965028 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1132,6 +1173,15 @@ const ( MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index f63ff6523..608878303 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1132,6 +1173,15 @@ const ( MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 1c8aea8b3..4cf9ddfad 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1132,6 +1173,15 @@ const ( MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 9e310b2e8..374e3007f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0xff CBAUDEX = 0x0 CFLUSH = 0xf @@ -1131,6 +1172,15 @@ const ( MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index e3f06606b..badf14102 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0xff CBAUDEX = 0x0 CFLUSH = 0xf @@ -1131,6 +1172,15 @@ const ( MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 9b36643b2..0ce8c7eff 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1132,6 +1173,15 @@ const ( MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 67134be21..47675125a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -229,6 +229,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -259,6 +260,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -332,6 +334,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1132,6 +1173,15 @@ const ( MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 100851b4b..a46fc9b43 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -232,6 +232,7 @@ const ( BPF_F_INDEX_MASK = 0xffffffff BPF_F_INGRESS = 0x1 BPF_F_INVALIDATE_HASH = 0x2 + BPF_F_LOCK = 0x4 BPF_F_MARK_ENFORCE = 0x40 BPF_F_MARK_MANGLED_0 = 0x20 BPF_F_NO_COMMON_LRU = 0x2 @@ -262,6 +263,7 @@ const ( BPF_JLE = 0xb0 BPF_JLT = 0xa0 BPF_JMP = 0x5 + BPF_JMP32 = 0x6 BPF_JNE = 0x50 BPF_JSET = 0x40 BPF_JSGE = 0x70 @@ -335,6 +337,45 @@ const ( CAN_SFF_MASK = 0x7ff CAN_TP16 = 0x3 CAN_TP20 = 0x4 + CAP_AUDIT_CONTROL = 0x1e + CAP_AUDIT_READ = 0x25 + CAP_AUDIT_WRITE = 0x1d + CAP_BLOCK_SUSPEND = 0x24 + CAP_CHOWN = 0x0 + CAP_DAC_OVERRIDE = 0x1 + CAP_DAC_READ_SEARCH = 0x2 + CAP_FOWNER = 0x3 + CAP_FSETID = 0x4 + CAP_IPC_LOCK = 0xe + CAP_IPC_OWNER = 0xf + CAP_KILL = 0x5 + CAP_LAST_CAP = 0x25 + CAP_LEASE = 0x1c + CAP_LINUX_IMMUTABLE = 0x9 + CAP_MAC_ADMIN = 0x21 + CAP_MAC_OVERRIDE = 0x20 + CAP_MKNOD = 0x1b + CAP_NET_ADMIN = 0xc + CAP_NET_BIND_SERVICE = 0xa + CAP_NET_BROADCAST = 0xb + CAP_NET_RAW = 0xd + CAP_SETFCAP = 0x1f + CAP_SETGID = 0x6 + CAP_SETPCAP = 0x8 + CAP_SETUID = 0x7 + CAP_SYSLOG = 0x22 + CAP_SYS_ADMIN = 0x15 + CAP_SYS_BOOT = 0x16 + CAP_SYS_CHROOT = 0x12 + CAP_SYS_MODULE = 0x10 + CAP_SYS_NICE = 0x17 + CAP_SYS_PACCT = 0x14 + CAP_SYS_PTRACE = 0x13 + CAP_SYS_RAWIO = 0x11 + CAP_SYS_RESOURCE = 0x18 + CAP_SYS_TIME = 0x19 + CAP_SYS_TTY_CONFIG = 0x1a + CAP_WAKE_ALARM = 0x23 CBAUD = 0x100f CBAUDEX = 0x1000 CFLUSH = 0xf @@ -1136,6 +1177,15 @@ const ( MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 MAP_TYPE = 0xf + MCAST_BLOCK_SOURCE = 0x2b + MCAST_EXCLUDE = 0x0 + MCAST_INCLUDE = 0x1 + MCAST_JOIN_GROUP = 0x2a + MCAST_JOIN_SOURCE_GROUP = 0x2e + MCAST_LEAVE_GROUP = 0x2d + MCAST_LEAVE_SOURCE_GROUP = 0x2f + MCAST_MSFILTER = 0x30 + MCAST_UNBLOCK_SOURCE = 0x2c MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go index ae9f1a21e..cdfe9318b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -749,6 +749,23 @@ func Ftruncate(fd int, length int64) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Getdents(fd int, buf []byte) (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_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index 80903e47b..a783306b2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -387,6 +387,16 @@ func pipe2(p *[2]_C_int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ptrace(request int, pid int, addr uintptr, data int) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { @@ -1019,7 +1029,7 @@ func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { +func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index cd250ff0e..f995520d3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -387,6 +387,16 @@ func pipe2(p *[2]_C_int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ptrace(request int, pid int, addr uintptr, data int) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { @@ -1019,7 +1029,7 @@ func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { +func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index 290a9c2cb..d681acd43 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -387,6 +387,16 @@ func pipe2(p *[2]_C_int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ptrace(request int, pid int, addr uintptr, data int) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { @@ -1019,7 +1029,7 @@ func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { +func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go index c6df9d2e8..5049b2ede 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go @@ -404,6 +404,16 @@ func Getcwd(buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ptrace(request int, pid int, addr uintptr, data int) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { @@ -1019,7 +1029,7 @@ func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { +func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index feb3c0393..c5e46e4cf 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index fa0cb252a..da8819e48 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index 092a91c71..6ad9be6dd 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index ad9820b59..f88331782 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index c82ce7d29..8eebc6c77 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index d1b77c193..ecf62a677 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index b8e45f98c..1ba0f7b6f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index e26c748d4..20012b2f0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index 0a958ca0b..2b520deaa 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index 658f361e7..d9f044c95 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go index daff30039..9feed65eb 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index caf6ea866..0a6515088 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index 369a04b57..e27f66930 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -408,6 +408,26 @@ func Adjtimex(buf *Timex) (state int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Capget(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Capset(hdr *CapUserHeader, data *CapUserData) (err error) { + _, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1381,8 +1401,12 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Signalfd(fd int, mask *Sigset_t, flags int) { - SyscallNoError(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(mask)), uintptr(flags)) +func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) { + r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0) + newfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } return } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index 642db7670..7e0582664 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -389,7 +389,7 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index 59585fee3..d94d076aa 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -389,7 +389,7 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index 6ec31434b..cf5bf3d05 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -389,7 +389,7 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go index 603d14433..243a9317c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -389,7 +389,7 @@ func pipe() (fd1 int, fd2 int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 6a489fac0..a9532d078 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -387,7 +387,7 @@ func pipe(p *[2]_C_int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 30cba4347..0cb9f0177 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -387,7 +387,7 @@ func pipe(p *[2]_C_int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index fa1beda33..6fc99b549 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -387,7 +387,7 @@ func pipe(p *[2]_C_int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index eb5899046..27878a72b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -387,7 +387,7 @@ func pipe(p *[2]_C_int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func getdents(fd int, buf []byte) (n int, err error) { +func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go index 55c3a3294..9474974b6 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go @@ -1,4 +1,4 @@ -// go run mksysnum.go https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master +// go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,freebsd @@ -118,8 +118,6 @@ const ( SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } @@ -133,10 +131,6 @@ const ( SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, off_t offset, int whence); } - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, off_t length); } - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, off_t length); } SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } @@ -164,6 +158,7 @@ const ( SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); } + SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } @@ -197,13 +192,10 @@ const ( SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } - SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } + SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } - SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } - SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } - SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, struct oaiocb * const *acb_list, int nent, struct osigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } @@ -236,7 +228,7 @@ const ( SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } - SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } + SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } @@ -258,7 +250,7 @@ const ( SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } @@ -293,8 +285,6 @@ const ( SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } - SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } - SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); } @@ -400,4 +390,7 @@ const ( SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } + SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, id_t id, struct vm_domain_policy_entry *policy); } + SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, id_t id, const struct vm_domain_policy_entry *policy); } + SYS_FDATASYNC = 550 // { int fdatasync(int fd); } ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go index b39be6cb8..48a7beae7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go @@ -1,4 +1,4 @@ -// go run mksysnum.go https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master +// go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,freebsd @@ -118,8 +118,6 @@ const ( SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } @@ -133,10 +131,6 @@ const ( SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, off_t offset, int whence); } - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, off_t length); } - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, off_t length); } SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } @@ -164,6 +158,7 @@ const ( SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); } + SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } @@ -197,13 +192,10 @@ const ( SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } - SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } + SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } - SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } - SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } - SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, struct oaiocb * const *acb_list, int nent, struct osigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } @@ -236,7 +228,7 @@ const ( SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } - SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } + SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } @@ -258,7 +250,7 @@ const ( SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } @@ -293,8 +285,6 @@ const ( SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } - SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } - SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); } @@ -400,4 +390,7 @@ const ( SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } + SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, id_t id, struct vm_domain_policy_entry *policy); } + SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, id_t id, const struct vm_domain_policy_entry *policy); } + SYS_FDATASYNC = 550 // { int fdatasync(int fd); } ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go index 44ffd4ce5..4a6dfd4a7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go @@ -1,4 +1,4 @@ -// go run mksysnum.go https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master +// go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,freebsd @@ -118,8 +118,6 @@ const ( SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } @@ -133,10 +131,6 @@ const ( SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, off_t offset, int whence); } - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, off_t length); } - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, off_t length); } SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } @@ -164,6 +158,7 @@ const ( SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); } SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); } + SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } @@ -197,13 +192,10 @@ const ( SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } - SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } + SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } - SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } - SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } - SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, struct oaiocb * const *acb_list, int nent, struct osigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } @@ -236,7 +228,7 @@ const ( SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } - SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } + SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } @@ -258,7 +250,7 @@ const ( SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } @@ -293,8 +285,6 @@ const ( SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } - SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } - SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); } @@ -400,4 +390,7 @@ const ( SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } + SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, id_t id, struct vm_domain_policy_entry *policy); } + SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, id_t id, const struct vm_domain_policy_entry *policy); } + SYS_FDATASYNC = 550 // { int fdatasync(int fd); } ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go index 9f21e9550..3e51af8ed 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go @@ -1,4 +1,4 @@ -// go run mksysnum.go https://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master +// go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm64,freebsd @@ -7,13 +7,13 @@ package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int - SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } - SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ - SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } @@ -21,20 +21,20 @@ const ( SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } - SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ - SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ - SYS_ACCEPT = 30 // { int accept(int s, \ - SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ - SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } + SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } @@ -42,56 +42,57 @@ const ( SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(u_int fd); } + SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } - SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } - SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ - SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } - SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ - SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ - SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int SYS_CHROOT = 61 // { int chroot(char *path); } - SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } - SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise ovadvise_args int SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ - SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ - SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, int prot); } + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } - SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } - SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ - SYS_SOCKET = 97 // { int socket(int domain, int type, \ - SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } + SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } - SYS_BIND = 104 // { int bind(int s, caddr_t name, \ - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ - SYS_GETRUSAGE = 117 // { int getrusage(int who, \ - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ - SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } + SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } @@ -99,24 +100,24 @@ const ( SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } - SYS_UTIMES = 138 // { int utimes(char *path, \ - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } - SYS_LGETFH = 160 // { int lgetfh(char *fname, \ - SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } + SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ - SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ - SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } @@ -127,269 +128,269 @@ const ( SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ - SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ - SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ - SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } - SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 233 // { int clock_settime( clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } - SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ - SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } - SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ - SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ - SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, \ - SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); } + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); } + SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); } + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } - SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } - SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ - SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); } + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, size_t count); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } - SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } - SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ - SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ - SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ - SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_MODNEXT = 300 // { int modnext(int modid); } - SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat *stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } - SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } - SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ - SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } - SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ - SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } - SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ - SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ - SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } - SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } - SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ - SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ - SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ - SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( \ - SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ - SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } + SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ - SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ - SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ - SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS_KEVENT = 363 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } - SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } - SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ - SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ - SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ - SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ - SYS_KENV = 390 // { int kenv(int what, const char *name, \ - SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ - SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ - SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ - SYS_STATFS = 396 // { int statfs(char *path, \ + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } + SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int mode); } + SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } - SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ - SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } - SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ - SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ - SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ - SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ - SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ - SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ - SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ - SYS_SIGACTION = 416 // { int sigaction(int sig, \ - SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( const char *path, int attrnamespace, const char *attrname); } + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } + SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } + SYS_SIGRETURN = 417 // { int sigreturn( const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } - SYS_SETCONTEXT = 422 // { int setcontext( \ - SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SETCONTEXT = 422 // { int setcontext( const struct __ucontext *ucp); } + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } - SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ - SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ - SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ - SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ - SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ - SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } - SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ - SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ - SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ - SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ - SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } + SYS_THR_SUSPEND = 442 // { int thr_suspend( const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } - SYS_AUDIT = 445 // { int audit(const void *record, \ - SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } - SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ - SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } - SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ - SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } - SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ - SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ - SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ - SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ - SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len,unsigned msg_prio, const struct timespec *abs_timeout);} + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } - SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } - SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ - SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ - SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ - SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ - SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ - SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ - SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr * from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } - SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } - SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ - SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ - SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ - SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ - SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ - SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ - SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ - SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ - SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ - SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ - SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ - SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ - SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ - SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); } + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } - SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ - SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } - SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ - SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ - SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } - SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } - SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ - SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } - SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ - SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ - SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ - SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ - SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ - SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ - SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ - SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ - SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ - SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ - SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ - SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ - SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ - SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ - SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ - SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ - SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } + SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } - SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ - SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ - SYS_FUTIMENS = 546 // { int futimens(int fd, \ - SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ - SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, \ - SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, \ + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } + SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } + SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } + SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, id_t id, struct vm_domain_policy_entry *policy); } + SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, id_t id, const struct vm_domain_policy_entry *policy); } SYS_FDATASYNC = 550 // { int fdatasync(int fd); } ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go index 0edc5409a..7312e95ff 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -324,11 +324,108 @@ const ( ) const ( - PTRACE_TRACEME = 0x0 - PTRACE_CONT = 0x7 - PTRACE_KILL = 0x8 + PTRACE_ATTACH = 0xa + PTRACE_CONT = 0x7 + PTRACE_DETACH = 0xb + PTRACE_GETFPREGS = 0x23 + PTRACE_GETFSBASE = 0x47 + PTRACE_GETLWPLIST = 0xf + PTRACE_GETNUMLWPS = 0xe + PTRACE_GETREGS = 0x21 + PTRACE_GETXSTATE = 0x45 + PTRACE_IO = 0xc + PTRACE_KILL = 0x8 + PTRACE_LWPEVENTS = 0x18 + PTRACE_LWPINFO = 0xd + PTRACE_SETFPREGS = 0x24 + PTRACE_SETREGS = 0x22 + PTRACE_SINGLESTEP = 0x9 + PTRACE_TRACEME = 0x0 ) +const ( + PIOD_READ_D = 0x1 + PIOD_WRITE_D = 0x2 + PIOD_READ_I = 0x3 + PIOD_WRITE_I = 0x4 +) + +const ( + PL_FLAG_BORN = 0x100 + PL_FLAG_EXITED = 0x200 + PL_FLAG_SI = 0x20 +) + +const ( + TRAP_BRKPT = 0x1 + TRAP_TRACE = 0x2 +) + +type PtraceLwpInfoStruct struct { + Lwpid int32 + Event int32 + Flags int32 + Sigmask Sigset_t + Siglist Sigset_t + Siginfo __Siginfo + Tdname [20]int8 + Child_pid int32 + Syscall_code uint32 + Syscall_narg uint32 +} + +type __Siginfo struct { + Signo int32 + Errno int32 + Code int32 + Pid int32 + Uid uint32 + Status int32 + Addr *byte + Value [4]byte + X_reason [32]byte +} + +type Sigset_t struct { + Val [4]uint32 +} + +type Reg struct { + Fs uint32 + Es uint32 + Ds uint32 + Edi uint32 + Esi uint32 + Ebp uint32 + Isp uint32 + Ebx uint32 + Edx uint32 + Ecx uint32 + Eax uint32 + Trapno uint32 + Err uint32 + Eip uint32 + Cs uint32 + Eflags uint32 + Esp uint32 + Ss uint32 + Gs uint32 +} + +type FpReg struct { + Env [7]uint32 + Acc [8][10]uint8 + Ex_sw uint32 + Pad [64]uint8 +} + +type PtraceIoDesc struct { + Op int32 + Offs *byte + Addr *byte + Len uint +} + type Kevent_t struct { Ident uint32 Filter int16 diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go index 8881ce842..29ba2f5bf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -322,11 +322,115 @@ const ( ) const ( - PTRACE_TRACEME = 0x0 - PTRACE_CONT = 0x7 - PTRACE_KILL = 0x8 + PTRACE_ATTACH = 0xa + PTRACE_CONT = 0x7 + PTRACE_DETACH = 0xb + PTRACE_GETFPREGS = 0x23 + PTRACE_GETFSBASE = 0x47 + PTRACE_GETLWPLIST = 0xf + PTRACE_GETNUMLWPS = 0xe + PTRACE_GETREGS = 0x21 + PTRACE_GETXSTATE = 0x45 + PTRACE_IO = 0xc + PTRACE_KILL = 0x8 + PTRACE_LWPEVENTS = 0x18 + PTRACE_LWPINFO = 0xd + PTRACE_SETFPREGS = 0x24 + PTRACE_SETREGS = 0x22 + PTRACE_SINGLESTEP = 0x9 + PTRACE_TRACEME = 0x0 ) +const ( + PIOD_READ_D = 0x1 + PIOD_WRITE_D = 0x2 + PIOD_READ_I = 0x3 + PIOD_WRITE_I = 0x4 +) + +const ( + PL_FLAG_BORN = 0x100 + PL_FLAG_EXITED = 0x200 + PL_FLAG_SI = 0x20 +) + +const ( + TRAP_BRKPT = 0x1 + TRAP_TRACE = 0x2 +) + +type PtraceLwpInfoStruct struct { + Lwpid int32 + Event int32 + Flags int32 + Sigmask Sigset_t + Siglist Sigset_t + Siginfo __Siginfo + Tdname [20]int8 + Child_pid int32 + Syscall_code uint32 + Syscall_narg uint32 +} + +type __Siginfo struct { + Signo int32 + Errno int32 + Code int32 + Pid int32 + Uid uint32 + Status int32 + Addr *byte + Value [8]byte + _ [40]byte +} + +type Sigset_t struct { + Val [4]uint32 +} + +type Reg struct { + R15 int64 + R14 int64 + R13 int64 + R12 int64 + R11 int64 + R10 int64 + R9 int64 + R8 int64 + Rdi int64 + Rsi int64 + Rbp int64 + Rbx int64 + Rdx int64 + Rcx int64 + Rax int64 + Trapno uint32 + Fs uint16 + Gs uint16 + Err uint32 + Es uint16 + Ds uint16 + Rip int64 + Cs int64 + Rflags int64 + Rsp int64 + Ss int64 +} + +type FpReg struct { + Env [4]uint64 + Acc [8][16]uint8 + Xacc [16][16]uint8 + Spare [12]uint64 +} + +type PtraceIoDesc struct { + Op int32 + Offs *byte + Addr *byte + Len uint +} + type Kevent_t struct { Ident uint64 Filter int16 diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go index fc713999c..b4090ef31 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -322,11 +322,92 @@ const ( ) const ( - PTRACE_TRACEME = 0x0 - PTRACE_CONT = 0x7 - PTRACE_KILL = 0x8 + PTRACE_ATTACH = 0xa + PTRACE_CONT = 0x7 + PTRACE_DETACH = 0xb + PTRACE_GETFPREGS = 0x23 + PTRACE_GETFSBASE = 0x47 + PTRACE_GETLWPLIST = 0xf + PTRACE_GETNUMLWPS = 0xe + PTRACE_GETREGS = 0x21 + PTRACE_GETXSTATE = 0x45 + PTRACE_IO = 0xc + PTRACE_KILL = 0x8 + PTRACE_LWPEVENTS = 0x18 + PTRACE_LWPINFO = 0xd + PTRACE_SETFPREGS = 0x24 + PTRACE_SETREGS = 0x22 + PTRACE_SINGLESTEP = 0x9 + PTRACE_TRACEME = 0x0 ) +const ( + PIOD_READ_D = 0x1 + PIOD_WRITE_D = 0x2 + PIOD_READ_I = 0x3 + PIOD_WRITE_I = 0x4 +) + +const ( + PL_FLAG_BORN = 0x100 + PL_FLAG_EXITED = 0x200 + PL_FLAG_SI = 0x20 +) + +const ( + TRAP_BRKPT = 0x1 + TRAP_TRACE = 0x2 +) + +type PtraceLwpInfoStruct struct { + Lwpid int32 + Event int32 + Flags int32 + Sigmask Sigset_t + Siglist Sigset_t + Siginfo __Siginfo + Tdname [20]int8 + Child_pid int32 + Syscall_code uint32 + Syscall_narg uint32 +} + +type __Siginfo struct { + Signo int32 + Errno int32 + Code int32 + Pid int32 + Uid uint32 + Status int32 + Addr *byte + Value [4]byte + X_reason [32]byte +} + +type Sigset_t struct { + Val [4]uint32 +} + +type Reg struct { + R [13]uint32 + R_sp uint32 + R_lr uint32 + R_pc uint32 + R_cpsr uint32 +} + +type FpReg struct { + Fpr_fpsr uint32 + Fpr [8][3]uint32 +} + +type PtraceIoDesc struct { + Op int32 + Offs *byte + Addr *byte + Len uint +} + type Kevent_t struct { Ident uint32 Filter int16 diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go index 5a0753ee4..1542a8773 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -322,11 +322,93 @@ const ( ) const ( - PTRACE_TRACEME = 0x0 - PTRACE_CONT = 0x7 - PTRACE_KILL = 0x8 + PTRACE_ATTACH = 0xa + PTRACE_CONT = 0x7 + PTRACE_DETACH = 0xb + PTRACE_GETFPREGS = 0x23 + PTRACE_GETFSBASE = 0x47 + PTRACE_GETLWPLIST = 0xf + PTRACE_GETNUMLWPS = 0xe + PTRACE_GETREGS = 0x21 + PTRACE_GETXSTATE = 0x45 + PTRACE_IO = 0xc + PTRACE_KILL = 0x8 + PTRACE_LWPEVENTS = 0x18 + PTRACE_LWPINFO = 0xd + PTRACE_SETFPREGS = 0x24 + PTRACE_SETREGS = 0x22 + PTRACE_SINGLESTEP = 0x9 + PTRACE_TRACEME = 0x0 ) +const ( + PIOD_READ_D = 0x1 + PIOD_WRITE_D = 0x2 + PIOD_READ_I = 0x3 + PIOD_WRITE_I = 0x4 +) + +const ( + PL_FLAG_BORN = 0x100 + PL_FLAG_EXITED = 0x200 + PL_FLAG_SI = 0x20 +) + +const ( + TRAP_BRKPT = 0x1 + TRAP_TRACE = 0x2 +) + +type PtraceLwpInfoStruct struct { + Lwpid int32 + Event int32 + Flags int32 + Sigmask Sigset_t + Siglist Sigset_t + Siginfo __Siginfo + Tdname [20]int8 + Child_pid int32 + Syscall_code uint32 + Syscall_narg uint32 +} + +type __Siginfo struct { + Signo int32 + Errno int32 + Code int32 + Pid int32 + Uid uint32 + Status int32 + Addr *byte + Value [8]byte + X_reason [40]byte +} + +type Sigset_t struct { + Val [4]uint32 +} + +type Reg struct { + X [30]uint64 + Lr uint64 + Sp uint64 + Elr uint64 + Spsr uint32 +} + +type FpReg struct { + Fp_q [32]uint128 + Fp_sr uint32 + Fp_cr uint32 +} + +type PtraceIoDesc struct { + Op int32 + Offs *byte + Addr *byte + Len uint +} + type Kevent_t struct { Ident uint64 Filter int16 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index b7a8cf380..5492b9666 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -829,6 +829,8 @@ type Sigset_t struct { Val [32]uint32 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2465,3 +2467,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index e41911542..caf33b2c5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -842,6 +842,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2478,3 +2480,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 1ce0dd620..93aec7e22 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -818,6 +818,8 @@ type Sigset_t struct { Val [32]uint32 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2456,3 +2458,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 9469b157b..0a038436d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -821,6 +821,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2457,3 +2459,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 13386ca23..2de0e5800 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -823,6 +823,8 @@ type Sigset_t struct { Val [32]uint32 } +const _C__NSIG = 0x80 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2462,3 +2464,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index e62ec4e40..3735eb42e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -823,6 +823,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x80 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2459,3 +2461,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 79953b3f0..073c29939 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -823,6 +823,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x80 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2459,3 +2461,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 48b3b5c34..58d09f75e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -823,6 +823,8 @@ type Sigset_t struct { Val [32]uint32 } +const _C__NSIG = 0x80 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2462,3 +2464,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 020f16c02..3f1e62e03 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -831,6 +831,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2467,3 +2469,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 92a9a8477..e67be11eb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -831,6 +831,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2467,3 +2469,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 4b82eeb84..f44f29403 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -848,6 +848,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2484,3 +2486,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index 6cf3031ef..90bf5dcc7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -844,6 +844,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2481,3 +2483,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 44b5c8edf..4f054dcbb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -826,6 +826,8 @@ type Sigset_t struct { Val [16]uint64 } +const _C__NSIG = 0x41 + type SignalfdSiginfo struct { Signo uint32 Errno int32 @@ -2462,3 +2464,20 @@ const ( BPF_FD_TYPE_UPROBE = 0x4 BPF_FD_TYPE_URETPROBE = 0x5 ) + +type CapUserHeader struct { + Version uint32 + Pid int32 +} + +type CapUserData struct { + Effective uint32 + Permitted uint32 + Inheritable uint32 +} + +const ( + LINUX_CAPABILITY_VERSION_1 = 0x19980330 + LINUX_CAPABILITY_VERSION_2 = 0x20071026 + LINUX_CAPABILITY_VERSION_3 = 0x20080522 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go index a2268b4f6..86736ab6e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go @@ -411,6 +411,7 @@ type Ptmget struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x200 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go index 59e1da0a6..3427811f9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go @@ -418,6 +418,7 @@ type Ptmget struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x200 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index 1f1f0f381..399f37a43 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -416,6 +416,7 @@ type Ptmget struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x200 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go index 8dca204a9..32f0c15d9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go @@ -418,6 +418,7 @@ type Ptmget struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x200 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go index 900fb4462..61ea0019a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go @@ -436,6 +436,7 @@ type Winsize struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x4 AT_SYMLINK_NOFOLLOW = 0x2 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go index 028fa78d7..87a493f68 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go @@ -436,6 +436,7 @@ type Winsize struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x4 AT_SYMLINK_NOFOLLOW = 0x2 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go index b45d5eedf..d80836efa 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go @@ -437,6 +437,7 @@ type Winsize struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x4 AT_SYMLINK_NOFOLLOW = 0x2 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go index fa369a32a..4e158746f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go @@ -430,6 +430,7 @@ type Winsize struct { const ( AT_FDCWD = -0x64 + AT_SYMLINK_FOLLOW = 0x4 AT_SYMLINK_NOFOLLOW = 0x2 ) diff --git a/vendor/golang.org/x/sys/windows/mkerrors.bash b/vendor/golang.org/x/sys/windows/mkerrors.bash index a70b24f39..2163843a1 100644 --- a/vendor/golang.org/x/sys/windows/mkerrors.bash +++ b/vendor/golang.org/x/sys/windows/mkerrors.bash @@ -7,14 +7,13 @@ set -e shopt -s nullglob -[[ $# -eq 1 ]] || { echo "Usage: $0 OUTPUT_FILE.go" >&2; exit 1; } winerror="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/shared/winerror.h | sort -Vr | head -n 1)" [[ -n $winerror ]] || { echo "Unable to find winerror.h" >&2; exit 1; } declare -A errors { - echo "// Code generated by 'go generate'; DO NOT EDIT." + echo "// Code generated by 'mkerrors.bash'; DO NOT EDIT." echo echo "package windows" echo "import \"syscall\"" @@ -61,4 +60,4 @@ declare -A errors done < "$winerror" echo ")" -} | gofmt > "$1" +} | gofmt > "zerrors_windows.go" diff --git a/vendor/golang.org/x/sys/windows/mkerrors.go b/vendor/golang.org/x/sys/windows/mkerrors.go deleted file mode 100644 index a204e6caa..000000000 --- a/vendor/golang.org/x/sys/windows/mkerrors.go +++ /dev/null @@ -1,9 +0,0 @@ -// 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. - -// +build generate - -package windows - -//go:generate ./mkerrors.bash zerrors_windows.go diff --git a/vendor/golang.org/x/sys/windows/mkknownfolderids.bash b/vendor/golang.org/x/sys/windows/mkknownfolderids.bash new file mode 100644 index 000000000..ab8924e93 --- /dev/null +++ b/vendor/golang.org/x/sys/windows/mkknownfolderids.bash @@ -0,0 +1,27 @@ +#!/bin/bash + +# 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. + +set -e +shopt -s nullglob + +knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" +[[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } + +{ + echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." + echo + echo "package windows" + echo "type KNOWNFOLDERID GUID" + echo "var (" + while read -r line; do + [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue + printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ + "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ + $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ + $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) + done < "$knownfolders" + echo ")" +} | gofmt > "zknownfolderids_windows.go" diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index e9d26bee3..61b49647b 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -170,15 +170,20 @@ const ( //sys CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) = advapi32.CopySid //sys AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) = advapi32.AllocateAndInitializeSid //sys createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) = advapi32.CreateWellKnownSid +//sys isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) = advapi32.IsWellKnownSid //sys FreeSid(sid *SID) (err error) [failretval!=0] = advapi32.FreeSid //sys EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) = advapi32.EqualSid +//sys getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) = advapi32.GetSidIdentifierAuthority +//sys getSidSubAuthorityCount(sid *SID) (count *uint8) = advapi32.GetSidSubAuthorityCount +//sys getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) = advapi32.GetSidSubAuthority +//sys isValidSid(sid *SID) (isValid bool) = advapi32.IsValidSid // The security identifier (SID) structure is a variable-length // structure used to uniquely identify users or groups. type SID struct{} // StringToSid converts a string-format security identifier -// sid into a valid, functional sid. +// SID into a valid, functional SID. func StringToSid(s string) (*SID, error) { var sid *SID p, e := UTF16PtrFromString(s) @@ -193,7 +198,7 @@ func StringToSid(s string) (*SID, error) { return sid.Copy() } -// LookupSID retrieves a security identifier sid for the account +// LookupSID retrieves a security identifier SID for the account // and the name of the domain on which the account was found. // System specify target computer to search. func LookupSID(system, account string) (sid *SID, domain string, accType uint32, err error) { @@ -230,7 +235,7 @@ func LookupSID(system, account string) (sid *SID, domain string, accType uint32, } } -// String converts sid to a string format +// String converts SID to a string format // suitable for display, storage, or transmission. func (sid *SID) String() (string, error) { var s *uint16 @@ -242,12 +247,12 @@ func (sid *SID) String() (string, error) { return UTF16ToString((*[256]uint16)(unsafe.Pointer(s))[:]), nil } -// Len returns the length, in bytes, of a valid security identifier sid. +// Len returns the length, in bytes, of a valid security identifier SID. func (sid *SID) Len() int { return int(GetLengthSid(sid)) } -// Copy creates a duplicate of security identifier sid. +// Copy creates a duplicate of security identifier SID. func (sid *SID) Copy() (*SID, error) { b := make([]byte, sid.Len()) sid2 := (*SID)(unsafe.Pointer(&b[0])) @@ -258,8 +263,42 @@ func (sid *SID) Copy() (*SID, error) { return sid2, nil } -// LookupAccount retrieves the name of the account for this sid -// and the name of the first domain on which this sid is found. +// IdentifierAuthority returns the identifier authority of the SID. +func (sid *SID) IdentifierAuthority() SidIdentifierAuthority { + return *getSidIdentifierAuthority(sid) +} + +// SubAuthorityCount returns the number of sub-authorities in the SID. +func (sid *SID) SubAuthorityCount() uint8 { + return *getSidSubAuthorityCount(sid) +} + +// SubAuthority returns the sub-authority of the SID as specified by +// the index, which must be less than sid.SubAuthorityCount(). +func (sid *SID) SubAuthority(idx uint32) uint32 { + if idx >= uint32(sid.SubAuthorityCount()) { + panic("sub-authority index out of range") + } + return *getSidSubAuthority(sid, idx) +} + +// IsValid returns whether the SID has a valid revision and length. +func (sid *SID) IsValid() bool { + return isValidSid(sid) +} + +// Equals compares two SIDs for equality. +func (sid *SID) Equals(sid2 *SID) bool { + return EqualSid(sid, sid2) +} + +// IsWellKnown determines whether the SID matches the well-known sidType. +func (sid *SID) IsWellKnown(sidType WELL_KNOWN_SID_TYPE) bool { + return isWellKnownSid(sid, sidType) +} + +// LookupAccount retrieves the name of the account for this SID +// and the name of the first domain on which this SID is found. // System specify target computer to search for. func (sid *SID) LookupAccount(system string) (account, domain string, accType uint32, err error) { var sys *uint16 @@ -287,7 +326,7 @@ func (sid *SID) LookupAccount(system string) (account, domain string, accType ui } } -// Various types of pre-specified sids that can be synthesized at runtime. +// Various types of pre-specified SIDs that can be synthesized and compared at runtime. type WELL_KNOWN_SID_TYPE uint32 const ( @@ -413,13 +452,13 @@ const ( WinBuiltinDeviceOwnersSid = 119 ) -// Creates a sid for a well-known predefined alias, generally using the constants of the form +// Creates a SID for a well-known predefined alias, generally using the constants of the form // Win*Sid, for the local machine. func CreateWellKnownSid(sidType WELL_KNOWN_SID_TYPE) (*SID, error) { return CreateWellKnownDomainSid(sidType, nil) } -// Creates a sid for a well-known predefined alias, generally using the constants of the form +// Creates a SID for a well-known predefined alias, generally using the constants of the form // Win*Sid, for the domain specified by the domainSid parameter. func CreateWellKnownDomainSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID) (*SID, error) { n := uint32(50) @@ -564,12 +603,22 @@ type Tokenprimarygroup struct { type Tokengroups struct { GroupCount uint32 - Groups [1]SIDAndAttributes + Groups [1]SIDAndAttributes // Use AllGroups() for iterating. +} + +// AllGroups returns a slice that can be used to iterate over the groups in g. +func (g *Tokengroups) AllGroups() []SIDAndAttributes { + return (*[(1 << 28) - 1]SIDAndAttributes)(unsafe.Pointer(&g.Groups[0]))[:g.GroupCount:g.GroupCount] } type Tokenprivileges struct { PrivilegeCount uint32 - Privileges [1]LUIDAndAttributes + Privileges [1]LUIDAndAttributes // Use AllPrivileges() for iterating. +} + +// AllPrivileges returns a slice that can be used to iterate over the privileges in p. +func (p *Tokenprivileges) AllPrivileges() []LUIDAndAttributes { + return (*[(1 << 27) - 1]LUIDAndAttributes)(unsafe.Pointer(&p.Privileges[0]))[:p.PrivilegeCount:p.PrivilegeCount] } type Tokenmandatorylabel struct { @@ -714,7 +763,7 @@ func (t Token) GetUserProfileDirectory() (string, error) { } } -// Returns whether the current token is elevated from a UAC perspective. +// IsElevated returns whether the current token is elevated from a UAC perspective. func (token Token) IsElevated() bool { var isElevated uint32 var outLen uint32 @@ -725,7 +774,7 @@ func (token Token) IsElevated() bool { return outLen == uint32(unsafe.Sizeof(isElevated)) && isElevated != 0 } -// Returns the linked token, which may be an elevated UAC token. +// GetLinkedToken returns the linked token, which may be an elevated UAC token. func (token Token) GetLinkedToken() (Token, error) { var linkedToken Token var outLen uint32 diff --git a/vendor/golang.org/x/sys/windows/service.go b/vendor/golang.org/x/sys/windows/service.go index 9a59b42f6..03383f1df 100644 --- a/vendor/golang.org/x/sys/windows/service.go +++ b/vendor/golang.org/x/sys/windows/service.go @@ -200,12 +200,19 @@ type SC_ACTION struct { Delay uint32 } +type QUERY_SERVICE_LOCK_STATUS struct { + IsLocked uint32 + LockOwner *uint16 + LockDuration uint32 +} + //sys CloseServiceHandle(handle Handle) (err error) = advapi32.CloseServiceHandle //sys CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) [failretval==0] = advapi32.CreateServiceW //sys OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) [failretval==0] = advapi32.OpenServiceW //sys DeleteService(service Handle) (err error) = advapi32.DeleteService //sys StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) = advapi32.StartServiceW //sys QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) = advapi32.QueryServiceStatus +//sys QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceLockStatusW //sys ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) = advapi32.ControlService //sys StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) = advapi32.StartServiceCtrlDispatcherW //sys SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) = advapi32.SetServiceStatus diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 42868ee84..b23050924 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -10,6 +10,7 @@ import ( errorspkg "errors" "sync" "syscall" + "time" "unicode/utf16" "unsafe" ) @@ -138,6 +139,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetVersion() (ver uint32, err error) //sys FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) = FormatMessageW //sys ExitProcess(exitcode uint32) +//sys IsWow64Process(handle Handle, isWow64 *bool) (err error) = IsWow64Process //sys CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) [failretval==InvalidHandle] = CreateFileW //sys ReadFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) //sys WriteFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) (err error) @@ -170,7 +172,9 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CancelIo(s Handle) (err error) //sys CancelIoEx(s Handle, o *Overlapped) (err error) //sys CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error) = CreateProcessW -//sys OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) +//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) = shell32.ShellExecuteW +//sys shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) = shell32.SHGetKnownFolderPath //sys TerminateProcess(handle Handle, exitcode uint32) (err error) //sys GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) //sys GetStartupInfo(startupInfo *StartupInfo) (err error) = GetStartupInfoW @@ -192,6 +196,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys SetEnvironmentVariable(name *uint16, value *uint16) (err error) = kernel32.SetEnvironmentVariableW //sys CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) = userenv.CreateEnvironmentBlock //sys DestroyEnvironmentBlock(block *uint16) (err error) = userenv.DestroyEnvironmentBlock +//sys getTickCount64() (ms uint64) = kernel32.GetTickCount64 //sys SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) //sys GetFileAttributes(name *uint16) (attrs uint32, err error) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW //sys SetFileAttributes(name *uint16, attrs uint32) (err error) = kernel32.SetFileAttributesW @@ -230,7 +235,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegQueryInfoKeyW //sys RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) = advapi32.RegEnumKeyExW //sys RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) = advapi32.RegQueryValueExW -//sys getCurrentProcessId() (pid uint32) = kernel32.GetCurrentProcessId +//sys GetCurrentProcessId() (pid uint32) = kernel32.GetCurrentProcessId //sys GetConsoleMode(console Handle, mode *uint32) (err error) = kernel32.GetConsoleMode //sys SetConsoleMode(console Handle, mode uint32) (err error) = kernel32.SetConsoleMode //sys GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) = kernel32.GetConsoleScreenBufferInfo @@ -239,6 +244,8 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) [failretval==InvalidHandle] = kernel32.CreateToolhelp32Snapshot //sys Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32FirstW //sys Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) = kernel32.Process32NextW +//sys Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) +//sys Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) //sys DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) // This function returns 1 byte BOOLEAN rather than the 4 byte BOOL. //sys CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) [failretval&0xff==0] = CreateSymbolicLinkW @@ -251,6 +258,17 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys ResetEvent(event Handle) (err error) = kernel32.ResetEvent //sys PulseEvent(event Handle) (err error) = kernel32.PulseEvent //sys SleepEx(milliseconds uint32, alertable bool) (ret uint32) = kernel32.SleepEx +//sys CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) = kernel32.CreateJobObjectW +//sys AssignProcessToJobObject(job Handle, process Handle) (err error) = kernel32.AssignProcessToJobObject +//sys TerminateJobObject(job Handle, exitCode uint32) (err error) = kernel32.TerminateJobObject +//sys SetErrorMode(mode uint32) (ret uint32) = kernel32.SetErrorMode +//sys ResumeThread(thread Handle) (ret uint32, err error) [failretval==0xffffffff] = kernel32.ResumeThread +//sys SetPriorityClass(process Handle, priorityClass uint32) (err error) = kernel32.SetPriorityClass +//sys GetPriorityClass(process Handle) (ret uint32, err error) = kernel32.GetPriorityClass +//sys SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) +//sys GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) +//sys GetProcessId(process Handle) (id uint32, err error) +//sys OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) // Volume Management Functions //sys DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) = DefineDosDeviceW @@ -272,6 +290,12 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) [failretval==0] = QueryDosDeviceW //sys SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) = SetVolumeLabelW //sys SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) = SetVolumeMountPointW +//sys MessageBox(hwnd Handle, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW +//sys clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) = ole32.CLSIDFromString +//sys stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) = ole32.StringFromGUID2 +//sys coCreateGuid(pguid *GUID) (ret error) = ole32.CoCreateGuid +//sys CoTaskMemFree(address unsafe.Pointer) = ole32.CoTaskMemFree +//sys rtlGetVersion(info *OsVersionInfoEx) (ret error) = ntdll.RtlGetVersion // syscall interface implementation for other packages @@ -486,6 +510,10 @@ func ComputerName() (name string, err error) { return string(utf16.Decode(b[0:n])), nil } +func DurationSinceBoot() time.Duration { + return time.Duration(getTickCount64()) * time.Millisecond +} + func Ftruncate(fd Handle, length int64) (err error) { curoffset, e := Seek(fd, 0, 1) if e != nil { @@ -1095,7 +1123,7 @@ func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } -func Getpid() (pid int) { return int(getCurrentProcessId()) } +func Getpid() (pid int) { return int(GetCurrentProcessId()) } func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) { // NOTE(rsc): The Win32finddata struct is wrong for the system call: @@ -1223,3 +1251,70 @@ func Readlink(path string, buf []byte) (n int, err error) { return n, nil } + +// GUIDFromString parses a string in the form of +// "{XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}" into a GUID. +func GUIDFromString(str string) (GUID, error) { + guid := GUID{} + str16, err := syscall.UTF16PtrFromString(str) + if err != nil { + return guid, err + } + err = clsidFromString(str16, &guid) + if err != nil { + return guid, err + } + return guid, nil +} + +// GenerateGUID creates a new random GUID. +func GenerateGUID() (GUID, error) { + guid := GUID{} + err := coCreateGuid(&guid) + if err != nil { + return guid, err + } + return guid, nil +} + +// String returns the canonical string form of the GUID, +// in the form of "{XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}". +func (guid GUID) String() string { + var str [100]uint16 + chars := stringFromGUID2(&guid, &str[0], int32(len(str))) + if chars <= 1 { + return "" + } + return string(utf16.Decode(str[:chars-1])) +} + +// KnownFolderPath returns a well-known folder path for the current user, specified by one of +// the FOLDERID_ constants, and chosen and optionally created based on a KF_ flag. +func KnownFolderPath(folderID *KNOWNFOLDERID, flags uint32) (string, error) { + return Token(0).KnownFolderPath(folderID, flags) +} + +// KnownFolderPath returns a well-known folder path for the user token, specified by one of +// the FOLDERID_ constants, and chosen and optionally created based on a KF_ flag. +func (t Token) KnownFolderPath(folderID *KNOWNFOLDERID, flags uint32) (string, error) { + var p *uint16 + err := shGetKnownFolderPath(folderID, flags, t, &p) + if err != nil { + return "", err + } + defer CoTaskMemFree(unsafe.Pointer(p)) + return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(p))[:]), nil +} + +// RtlGetVersion returns the true version of the underlying operating system, ignoring +// any manifesting or compatibility layers on top of the win32 layer. +func RtlGetVersion() *OsVersionInfoEx { + info := &OsVersionInfoEx{} + info.osVersionInfoSize = uint32(unsafe.Sizeof(*info)) + // According to documentation, this function always succeeds. + // The function doesn't even check the validity of the + // osVersionInfoSize member. Disassembling ntdll.dll indicates + // that the documentation is indeed correct about that. + _ = rtlGetVersion(info) + return info +} diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index ee2793684..8a563f92b 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -4,7 +4,11 @@ package windows -import "syscall" +import ( + "net" + "syscall" + "unsafe" +) const ( // Invented values to support what package os expects. @@ -154,9 +158,39 @@ const ( WAIT_OBJECT_0 = 0x00000000 WAIT_FAILED = 0xFFFFFFFF - PROCESS_TERMINATE = 1 - PROCESS_QUERY_INFORMATION = 0x00000400 - SYNCHRONIZE = 0x00100000 + // Standard access rights. + DELETE = 0x00010000 + READ_CONTROL = 0x00020000 + SYNCHRONIZE = 0x00100000 + WRITE_DAC = 0x00040000 + WRITE_OWNER = 0x00080000 + + // Access rights for process. + PROCESS_CREATE_PROCESS = 0x0080 + PROCESS_CREATE_THREAD = 0x0002 + PROCESS_DUP_HANDLE = 0x0040 + PROCESS_QUERY_INFORMATION = 0x0400 + PROCESS_QUERY_LIMITED_INFORMATION = 0x1000 + PROCESS_SET_INFORMATION = 0x0200 + PROCESS_SET_QUOTA = 0x0100 + PROCESS_SUSPEND_RESUME = 0x0800 + PROCESS_TERMINATE = 0x0001 + PROCESS_VM_OPERATION = 0x0008 + PROCESS_VM_READ = 0x0010 + PROCESS_VM_WRITE = 0x0020 + + // Access rights for thread. + THREAD_DIRECT_IMPERSONATION = 0x0200 + THREAD_GET_CONTEXT = 0x0008 + THREAD_IMPERSONATE = 0x0100 + THREAD_QUERY_INFORMATION = 0x0040 + THREAD_QUERY_LIMITED_INFORMATION = 0x0800 + THREAD_SET_CONTEXT = 0x0010 + THREAD_SET_INFORMATION = 0x0020 + THREAD_SET_LIMITED_INFORMATION = 0x0400 + THREAD_SET_THREAD_TOKEN = 0x0080 + THREAD_SUSPEND_RESUME = 0x0002 + THREAD_TERMINATE = 0x0001 FILE_MAP_COPY = 0x01 FILE_MAP_WRITE = 0x02 @@ -396,6 +430,26 @@ const ( SECURITY_FLAG_IGNORE_CERT_DATE_INVALID = 0x00002000 ) +const ( + // flags for SetErrorMode + SEM_FAILCRITICALERRORS = 0x0001 + SEM_NOALIGNMENTFAULTEXCEPT = 0x0004 + SEM_NOGPFAULTERRORBOX = 0x0002 + SEM_NOOPENFILEERRORBOX = 0x8000 +) + +const ( + // Priority class. + ABOVE_NORMAL_PRIORITY_CLASS = 0x00008000 + BELOW_NORMAL_PRIORITY_CLASS = 0x00004000 + HIGH_PRIORITY_CLASS = 0x00000080 + IDLE_PRIORITY_CLASS = 0x00000040 + NORMAL_PRIORITY_CLASS = 0x00000020 + PROCESS_MODE_BACKGROUND_BEGIN = 0x00100000 + PROCESS_MODE_BACKGROUND_END = 0x00200000 + REALTIME_PRIORITY_CLASS = 0x00000100 +) + var ( OID_PKIX_KP_SERVER_AUTH = []byte("1.3.6.1.5.5.7.3.1\x00") OID_SERVER_GATED_CRYPTO = []byte("1.3.6.1.4.1.311.10.3.3\x00") @@ -605,6 +659,16 @@ type ProcessEntry32 struct { ExeFile [MAX_PATH]uint16 } +type ThreadEntry32 struct { + Size uint32 + Usage uint32 + ThreadID uint32 + OwnerProcessID uint32 + BasePri int32 + DeltaPri int32 + Flags uint32 +} + type Systemtime struct { Year uint16 Month uint16 @@ -1286,6 +1350,41 @@ const ( ComputerNameMax = 8 ) +// For MessageBox() +const ( + MB_OK = 0x00000000 + MB_OKCANCEL = 0x00000001 + MB_ABORTRETRYIGNORE = 0x00000002 + MB_YESNOCANCEL = 0x00000003 + MB_YESNO = 0x00000004 + MB_RETRYCANCEL = 0x00000005 + MB_CANCELTRYCONTINUE = 0x00000006 + MB_ICONHAND = 0x00000010 + MB_ICONQUESTION = 0x00000020 + MB_ICONEXCLAMATION = 0x00000030 + MB_ICONASTERISK = 0x00000040 + MB_USERICON = 0x00000080 + MB_ICONWARNING = MB_ICONEXCLAMATION + MB_ICONERROR = MB_ICONHAND + MB_ICONINFORMATION = MB_ICONASTERISK + MB_ICONSTOP = MB_ICONHAND + MB_DEFBUTTON1 = 0x00000000 + MB_DEFBUTTON2 = 0x00000100 + MB_DEFBUTTON3 = 0x00000200 + MB_DEFBUTTON4 = 0x00000300 + MB_APPLMODAL = 0x00000000 + MB_SYSTEMMODAL = 0x00001000 + MB_TASKMODAL = 0x00002000 + MB_HELP = 0x00004000 + MB_NOFOCUS = 0x00008000 + MB_SETFOREGROUND = 0x00010000 + MB_DEFAULT_DESKTOP_ONLY = 0x00020000 + MB_TOPMOST = 0x00040000 + MB_RIGHT = 0x00080000 + MB_RTLREADING = 0x00100000 + MB_SERVICE_NOTIFICATION = 0x00200000 +) + const ( MOVEFILE_REPLACE_EXISTING = 0x1 MOVEFILE_COPY_ALLOWED = 0x2 @@ -1314,6 +1413,16 @@ type SocketAddress struct { SockaddrLength int32 } +// IP returns an IPv4 or IPv6 address, or nil if the underlying SocketAddress is neither. +func (addr *SocketAddress) IP() net.IP { + if uintptr(addr.SockaddrLength) >= unsafe.Sizeof(RawSockaddrInet4{}) && addr.Sockaddr.Addr.Family == AF_INET { + return (*RawSockaddrInet4)(unsafe.Pointer(addr.Sockaddr)).Addr[:] + } else if uintptr(addr.SockaddrLength) >= unsafe.Sizeof(RawSockaddrInet6{}) && addr.Sockaddr.Addr.Family == AF_INET6 { + return (*RawSockaddrInet6)(unsafe.Pointer(addr.Sockaddr)).Addr[:] + } + return nil +} + type IpAdapterUnicastAddress struct { Length uint32 Flags uint32 @@ -1439,3 +1548,118 @@ type ConsoleScreenBufferInfo struct { } const UNIX_PATH_MAX = 108 // defined in afunix.h + +const ( + // flags for JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags + JOB_OBJECT_LIMIT_ACTIVE_PROCESS = 0x00000008 + JOB_OBJECT_LIMIT_AFFINITY = 0x00000010 + JOB_OBJECT_LIMIT_BREAKAWAY_OK = 0x00000800 + JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION = 0x00000400 + JOB_OBJECT_LIMIT_JOB_MEMORY = 0x00000200 + JOB_OBJECT_LIMIT_JOB_TIME = 0x00000004 + JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = 0x00002000 + JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME = 0x00000040 + JOB_OBJECT_LIMIT_PRIORITY_CLASS = 0x00000020 + JOB_OBJECT_LIMIT_PROCESS_MEMORY = 0x00000100 + JOB_OBJECT_LIMIT_PROCESS_TIME = 0x00000002 + JOB_OBJECT_LIMIT_SCHEDULING_CLASS = 0x00000080 + JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK = 0x00001000 + JOB_OBJECT_LIMIT_SUBSET_AFFINITY = 0x00004000 + JOB_OBJECT_LIMIT_WORKINGSET = 0x00000001 +) + +type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { + PerProcessUserTimeLimit int64 + PerJobUserTimeLimit int64 + LimitFlags uint32 + MinimumWorkingSetSize uintptr + MaximumWorkingSetSize uintptr + ActiveProcessLimit uint32 + Affinity uintptr + PriorityClass uint32 + SchedulingClass uint32 +} + +type IO_COUNTERS struct { + ReadOperationCount uint64 + WriteOperationCount uint64 + OtherOperationCount uint64 + ReadTransferCount uint64 + WriteTransferCount uint64 + OtherTransferCount uint64 +} + +type JOBOBJECT_EXTENDED_LIMIT_INFORMATION struct { + BasicLimitInformation JOBOBJECT_BASIC_LIMIT_INFORMATION + IoInfo IO_COUNTERS + ProcessMemoryLimit uintptr + JobMemoryLimit uintptr + PeakProcessMemoryUsed uintptr + PeakJobMemoryUsed uintptr +} + +const ( + // UIRestrictionsClass + JOB_OBJECT_UILIMIT_DESKTOP = 0x00000040 + JOB_OBJECT_UILIMIT_DISPLAYSETTINGS = 0x00000010 + JOB_OBJECT_UILIMIT_EXITWINDOWS = 0x00000080 + JOB_OBJECT_UILIMIT_GLOBALATOMS = 0x00000020 + JOB_OBJECT_UILIMIT_HANDLES = 0x00000001 + JOB_OBJECT_UILIMIT_READCLIPBOARD = 0x00000002 + JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS = 0x00000008 + JOB_OBJECT_UILIMIT_WRITECLIPBOARD = 0x00000004 +) + +type JOBOBJECT_BASIC_UI_RESTRICTIONS struct { + UIRestrictionsClass uint32 +} + +const ( + // JobObjectInformationClass + JobObjectAssociateCompletionPortInformation = 7 + JobObjectBasicLimitInformation = 2 + JobObjectBasicUIRestrictions = 4 + JobObjectCpuRateControlInformation = 15 + JobObjectEndOfJobTimeInformation = 6 + JobObjectExtendedLimitInformation = 9 + JobObjectGroupInformation = 11 + JobObjectGroupInformationEx = 14 + JobObjectLimitViolationInformation2 = 35 + JobObjectNetRateControlInformation = 32 + JobObjectNotificationLimitInformation = 12 + JobObjectNotificationLimitInformation2 = 34 + JobObjectSecurityLimitInformation = 5 +) + +const ( + KF_FLAG_DEFAULT = 0x00000000 + KF_FLAG_FORCE_APP_DATA_REDIRECTION = 0x00080000 + KF_FLAG_RETURN_FILTER_REDIRECTION_TARGET = 0x00040000 + KF_FLAG_FORCE_PACKAGE_REDIRECTION = 0x00020000 + KF_FLAG_NO_PACKAGE_REDIRECTION = 0x00010000 + KF_FLAG_FORCE_APPCONTAINER_REDIRECTION = 0x00020000 + KF_FLAG_NO_APPCONTAINER_REDIRECTION = 0x00010000 + KF_FLAG_CREATE = 0x00008000 + KF_FLAG_DONT_VERIFY = 0x00004000 + KF_FLAG_DONT_UNEXPAND = 0x00002000 + KF_FLAG_NO_ALIAS = 0x00001000 + KF_FLAG_INIT = 0x00000800 + KF_FLAG_DEFAULT_PATH = 0x00000400 + KF_FLAG_NOT_PARENT_RELATIVE = 0x00000200 + KF_FLAG_SIMPLE_IDLIST = 0x00000100 + KF_FLAG_ALIAS_ONLY = 0x80000000 +) + +type OsVersionInfoEx struct { + osVersionInfoSize uint32 + MajorVersion uint32 + MinorVersion uint32 + BuildNumber uint32 + PlatformId uint32 + CsdVersion [128]uint16 + ServicePackMajor uint16 + ServicePackMinor uint16 + SuiteMask uint16 + ProductType byte + _ byte +} diff --git a/vendor/golang.org/x/sys/windows/zerrors_windows.go b/vendor/golang.org/x/sys/windows/zerrors_windows.go index 2b4cea5b9..f02120035 100644 --- a/vendor/golang.org/x/sys/windows/zerrors_windows.go +++ b/vendor/golang.org/x/sys/windows/zerrors_windows.go @@ -1,4 +1,4 @@ -// Code generated by 'go generate'; DO NOT EDIT. +// Code generated by 'mkerrors.bash'; DO NOT EDIT. package windows diff --git a/vendor/golang.org/x/sys/windows/zknownfolderids_windows.go b/vendor/golang.org/x/sys/windows/zknownfolderids_windows.go new file mode 100644 index 000000000..6048ac679 --- /dev/null +++ b/vendor/golang.org/x/sys/windows/zknownfolderids_windows.go @@ -0,0 +1,149 @@ +// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT. + +package windows + +type KNOWNFOLDERID GUID + +var ( + FOLDERID_NetworkFolder = &KNOWNFOLDERID{0xd20beec4, 0x5ca8, 0x4905, [8]byte{0xae, 0x3b, 0xbf, 0x25, 0x1e, 0xa0, 0x9b, 0x53}} + FOLDERID_ComputerFolder = &KNOWNFOLDERID{0x0ac0837c, 0xbbf8, 0x452a, [8]byte{0x85, 0x0d, 0x79, 0xd0, 0x8e, 0x66, 0x7c, 0xa7}} + FOLDERID_InternetFolder = &KNOWNFOLDERID{0x4d9f7874, 0x4e0c, 0x4904, [8]byte{0x96, 0x7b, 0x40, 0xb0, 0xd2, 0x0c, 0x3e, 0x4b}} + FOLDERID_ControlPanelFolder = &KNOWNFOLDERID{0x82a74aeb, 0xaeb4, 0x465c, [8]byte{0xa0, 0x14, 0xd0, 0x97, 0xee, 0x34, 0x6d, 0x63}} + FOLDERID_PrintersFolder = &KNOWNFOLDERID{0x76fc4e2d, 0xd6ad, 0x4519, [8]byte{0xa6, 0x63, 0x37, 0xbd, 0x56, 0x06, 0x81, 0x85}} + FOLDERID_SyncManagerFolder = &KNOWNFOLDERID{0x43668bf8, 0xc14e, 0x49b2, [8]byte{0x97, 0xc9, 0x74, 0x77, 0x84, 0xd7, 0x84, 0xb7}} + FOLDERID_SyncSetupFolder = &KNOWNFOLDERID{0x0f214138, 0xb1d3, 0x4a90, [8]byte{0xbb, 0xa9, 0x27, 0xcb, 0xc0, 0xc5, 0x38, 0x9a}} + FOLDERID_ConflictFolder = &KNOWNFOLDERID{0x4bfefb45, 0x347d, 0x4006, [8]byte{0xa5, 0xbe, 0xac, 0x0c, 0xb0, 0x56, 0x71, 0x92}} + FOLDERID_SyncResultsFolder = &KNOWNFOLDERID{0x289a9a43, 0xbe44, 0x4057, [8]byte{0xa4, 0x1b, 0x58, 0x7a, 0x76, 0xd7, 0xe7, 0xf9}} + FOLDERID_RecycleBinFolder = &KNOWNFOLDERID{0xb7534046, 0x3ecb, 0x4c18, [8]byte{0xbe, 0x4e, 0x64, 0xcd, 0x4c, 0xb7, 0xd6, 0xac}} + FOLDERID_ConnectionsFolder = &KNOWNFOLDERID{0x6f0cd92b, 0x2e97, 0x45d1, [8]byte{0x88, 0xff, 0xb0, 0xd1, 0x86, 0xb8, 0xde, 0xdd}} + FOLDERID_Fonts = &KNOWNFOLDERID{0xfd228cb7, 0xae11, 0x4ae3, [8]byte{0x86, 0x4c, 0x16, 0xf3, 0x91, 0x0a, 0xb8, 0xfe}} + FOLDERID_Desktop = &KNOWNFOLDERID{0xb4bfcc3a, 0xdb2c, 0x424c, [8]byte{0xb0, 0x29, 0x7f, 0xe9, 0x9a, 0x87, 0xc6, 0x41}} + FOLDERID_Startup = &KNOWNFOLDERID{0xb97d20bb, 0xf46a, 0x4c97, [8]byte{0xba, 0x10, 0x5e, 0x36, 0x08, 0x43, 0x08, 0x54}} + FOLDERID_Programs = &KNOWNFOLDERID{0xa77f5d77, 0x2e2b, 0x44c3, [8]byte{0xa6, 0xa2, 0xab, 0xa6, 0x01, 0x05, 0x4a, 0x51}} + FOLDERID_StartMenu = &KNOWNFOLDERID{0x625b53c3, 0xab48, 0x4ec1, [8]byte{0xba, 0x1f, 0xa1, 0xef, 0x41, 0x46, 0xfc, 0x19}} + FOLDERID_Recent = &KNOWNFOLDERID{0xae50c081, 0xebd2, 0x438a, [8]byte{0x86, 0x55, 0x8a, 0x09, 0x2e, 0x34, 0x98, 0x7a}} + FOLDERID_SendTo = &KNOWNFOLDERID{0x8983036c, 0x27c0, 0x404b, [8]byte{0x8f, 0x08, 0x10, 0x2d, 0x10, 0xdc, 0xfd, 0x74}} + FOLDERID_Documents = &KNOWNFOLDERID{0xfdd39ad0, 0x238f, 0x46af, [8]byte{0xad, 0xb4, 0x6c, 0x85, 0x48, 0x03, 0x69, 0xc7}} + FOLDERID_Favorites = &KNOWNFOLDERID{0x1777f761, 0x68ad, 0x4d8a, [8]byte{0x87, 0xbd, 0x30, 0xb7, 0x59, 0xfa, 0x33, 0xdd}} + FOLDERID_NetHood = &KNOWNFOLDERID{0xc5abbf53, 0xe17f, 0x4121, [8]byte{0x89, 0x00, 0x86, 0x62, 0x6f, 0xc2, 0xc9, 0x73}} + FOLDERID_PrintHood = &KNOWNFOLDERID{0x9274bd8d, 0xcfd1, 0x41c3, [8]byte{0xb3, 0x5e, 0xb1, 0x3f, 0x55, 0xa7, 0x58, 0xf4}} + FOLDERID_Templates = &KNOWNFOLDERID{0xa63293e8, 0x664e, 0x48db, [8]byte{0xa0, 0x79, 0xdf, 0x75, 0x9e, 0x05, 0x09, 0xf7}} + FOLDERID_CommonStartup = &KNOWNFOLDERID{0x82a5ea35, 0xd9cd, 0x47c5, [8]byte{0x96, 0x29, 0xe1, 0x5d, 0x2f, 0x71, 0x4e, 0x6e}} + FOLDERID_CommonPrograms = &KNOWNFOLDERID{0x0139d44e, 0x6afe, 0x49f2, [8]byte{0x86, 0x90, 0x3d, 0xaf, 0xca, 0xe6, 0xff, 0xb8}} + FOLDERID_CommonStartMenu = &KNOWNFOLDERID{0xa4115719, 0xd62e, 0x491d, [8]byte{0xaa, 0x7c, 0xe7, 0x4b, 0x8b, 0xe3, 0xb0, 0x67}} + FOLDERID_PublicDesktop = &KNOWNFOLDERID{0xc4aa340d, 0xf20f, 0x4863, [8]byte{0xaf, 0xef, 0xf8, 0x7e, 0xf2, 0xe6, 0xba, 0x25}} + FOLDERID_ProgramData = &KNOWNFOLDERID{0x62ab5d82, 0xfdc1, 0x4dc3, [8]byte{0xa9, 0xdd, 0x07, 0x0d, 0x1d, 0x49, 0x5d, 0x97}} + FOLDERID_CommonTemplates = &KNOWNFOLDERID{0xb94237e7, 0x57ac, 0x4347, [8]byte{0x91, 0x51, 0xb0, 0x8c, 0x6c, 0x32, 0xd1, 0xf7}} + FOLDERID_PublicDocuments = &KNOWNFOLDERID{0xed4824af, 0xdce4, 0x45a8, [8]byte{0x81, 0xe2, 0xfc, 0x79, 0x65, 0x08, 0x36, 0x34}} + FOLDERID_RoamingAppData = &KNOWNFOLDERID{0x3eb685db, 0x65f9, 0x4cf6, [8]byte{0xa0, 0x3a, 0xe3, 0xef, 0x65, 0x72, 0x9f, 0x3d}} + FOLDERID_LocalAppData = &KNOWNFOLDERID{0xf1b32785, 0x6fba, 0x4fcf, [8]byte{0x9d, 0x55, 0x7b, 0x8e, 0x7f, 0x15, 0x70, 0x91}} + FOLDERID_LocalAppDataLow = &KNOWNFOLDERID{0xa520a1a4, 0x1780, 0x4ff6, [8]byte{0xbd, 0x18, 0x16, 0x73, 0x43, 0xc5, 0xaf, 0x16}} + FOLDERID_InternetCache = &KNOWNFOLDERID{0x352481e8, 0x33be, 0x4251, [8]byte{0xba, 0x85, 0x60, 0x07, 0xca, 0xed, 0xcf, 0x9d}} + FOLDERID_Cookies = &KNOWNFOLDERID{0x2b0f765d, 0xc0e9, 0x4171, [8]byte{0x90, 0x8e, 0x08, 0xa6, 0x11, 0xb8, 0x4f, 0xf6}} + FOLDERID_History = &KNOWNFOLDERID{0xd9dc8a3b, 0xb784, 0x432e, [8]byte{0xa7, 0x81, 0x5a, 0x11, 0x30, 0xa7, 0x59, 0x63}} + FOLDERID_System = &KNOWNFOLDERID{0x1ac14e77, 0x02e7, 0x4e5d, [8]byte{0xb7, 0x44, 0x2e, 0xb1, 0xae, 0x51, 0x98, 0xb7}} + FOLDERID_SystemX86 = &KNOWNFOLDERID{0xd65231b0, 0xb2f1, 0x4857, [8]byte{0xa4, 0xce, 0xa8, 0xe7, 0xc6, 0xea, 0x7d, 0x27}} + FOLDERID_Windows = &KNOWNFOLDERID{0xf38bf404, 0x1d43, 0x42f2, [8]byte{0x93, 0x05, 0x67, 0xde, 0x0b, 0x28, 0xfc, 0x23}} + FOLDERID_Profile = &KNOWNFOLDERID{0x5e6c858f, 0x0e22, 0x4760, [8]byte{0x9a, 0xfe, 0xea, 0x33, 0x17, 0xb6, 0x71, 0x73}} + FOLDERID_Pictures = &KNOWNFOLDERID{0x33e28130, 0x4e1e, 0x4676, [8]byte{0x83, 0x5a, 0x98, 0x39, 0x5c, 0x3b, 0xc3, 0xbb}} + FOLDERID_ProgramFilesX86 = &KNOWNFOLDERID{0x7c5a40ef, 0xa0fb, 0x4bfc, [8]byte{0x87, 0x4a, 0xc0, 0xf2, 0xe0, 0xb9, 0xfa, 0x8e}} + FOLDERID_ProgramFilesCommonX86 = &KNOWNFOLDERID{0xde974d24, 0xd9c6, 0x4d3e, [8]byte{0xbf, 0x91, 0xf4, 0x45, 0x51, 0x20, 0xb9, 0x17}} + FOLDERID_ProgramFilesX64 = &KNOWNFOLDERID{0x6d809377, 0x6af0, 0x444b, [8]byte{0x89, 0x57, 0xa3, 0x77, 0x3f, 0x02, 0x20, 0x0e}} + FOLDERID_ProgramFilesCommonX64 = &KNOWNFOLDERID{0x6365d5a7, 0x0f0d, 0x45e5, [8]byte{0x87, 0xf6, 0x0d, 0xa5, 0x6b, 0x6a, 0x4f, 0x7d}} + FOLDERID_ProgramFiles = &KNOWNFOLDERID{0x905e63b6, 0xc1bf, 0x494e, [8]byte{0xb2, 0x9c, 0x65, 0xb7, 0x32, 0xd3, 0xd2, 0x1a}} + FOLDERID_ProgramFilesCommon = &KNOWNFOLDERID{0xf7f1ed05, 0x9f6d, 0x47a2, [8]byte{0xaa, 0xae, 0x29, 0xd3, 0x17, 0xc6, 0xf0, 0x66}} + FOLDERID_UserProgramFiles = &KNOWNFOLDERID{0x5cd7aee2, 0x2219, 0x4a67, [8]byte{0xb8, 0x5d, 0x6c, 0x9c, 0xe1, 0x56, 0x60, 0xcb}} + FOLDERID_UserProgramFilesCommon = &KNOWNFOLDERID{0xbcbd3057, 0xca5c, 0x4622, [8]byte{0xb4, 0x2d, 0xbc, 0x56, 0xdb, 0x0a, 0xe5, 0x16}} + FOLDERID_AdminTools = &KNOWNFOLDERID{0x724ef170, 0xa42d, 0x4fef, [8]byte{0x9f, 0x26, 0xb6, 0x0e, 0x84, 0x6f, 0xba, 0x4f}} + FOLDERID_CommonAdminTools = &KNOWNFOLDERID{0xd0384e7d, 0xbac3, 0x4797, [8]byte{0x8f, 0x14, 0xcb, 0xa2, 0x29, 0xb3, 0x92, 0xb5}} + FOLDERID_Music = &KNOWNFOLDERID{0x4bd8d571, 0x6d19, 0x48d3, [8]byte{0xbe, 0x97, 0x42, 0x22, 0x20, 0x08, 0x0e, 0x43}} + FOLDERID_Videos = &KNOWNFOLDERID{0x18989b1d, 0x99b5, 0x455b, [8]byte{0x84, 0x1c, 0xab, 0x7c, 0x74, 0xe4, 0xdd, 0xfc}} + FOLDERID_Ringtones = &KNOWNFOLDERID{0xc870044b, 0xf49e, 0x4126, [8]byte{0xa9, 0xc3, 0xb5, 0x2a, 0x1f, 0xf4, 0x11, 0xe8}} + FOLDERID_PublicPictures = &KNOWNFOLDERID{0xb6ebfb86, 0x6907, 0x413c, [8]byte{0x9a, 0xf7, 0x4f, 0xc2, 0xab, 0xf0, 0x7c, 0xc5}} + FOLDERID_PublicMusic = &KNOWNFOLDERID{0x3214fab5, 0x9757, 0x4298, [8]byte{0xbb, 0x61, 0x92, 0xa9, 0xde, 0xaa, 0x44, 0xff}} + FOLDERID_PublicVideos = &KNOWNFOLDERID{0x2400183a, 0x6185, 0x49fb, [8]byte{0xa2, 0xd8, 0x4a, 0x39, 0x2a, 0x60, 0x2b, 0xa3}} + FOLDERID_PublicRingtones = &KNOWNFOLDERID{0xe555ab60, 0x153b, 0x4d17, [8]byte{0x9f, 0x04, 0xa5, 0xfe, 0x99, 0xfc, 0x15, 0xec}} + FOLDERID_ResourceDir = &KNOWNFOLDERID{0x8ad10c31, 0x2adb, 0x4296, [8]byte{0xa8, 0xf7, 0xe4, 0x70, 0x12, 0x32, 0xc9, 0x72}} + FOLDERID_LocalizedResourcesDir = &KNOWNFOLDERID{0x2a00375e, 0x224c, 0x49de, [8]byte{0xb8, 0xd1, 0x44, 0x0d, 0xf7, 0xef, 0x3d, 0xdc}} + FOLDERID_CommonOEMLinks = &KNOWNFOLDERID{0xc1bae2d0, 0x10df, 0x4334, [8]byte{0xbe, 0xdd, 0x7a, 0xa2, 0x0b, 0x22, 0x7a, 0x9d}} + FOLDERID_CDBurning = &KNOWNFOLDERID{0x9e52ab10, 0xf80d, 0x49df, [8]byte{0xac, 0xb8, 0x43, 0x30, 0xf5, 0x68, 0x78, 0x55}} + FOLDERID_UserProfiles = &KNOWNFOLDERID{0x0762d272, 0xc50a, 0x4bb0, [8]byte{0xa3, 0x82, 0x69, 0x7d, 0xcd, 0x72, 0x9b, 0x80}} + FOLDERID_Playlists = &KNOWNFOLDERID{0xde92c1c7, 0x837f, 0x4f69, [8]byte{0xa3, 0xbb, 0x86, 0xe6, 0x31, 0x20, 0x4a, 0x23}} + FOLDERID_SamplePlaylists = &KNOWNFOLDERID{0x15ca69b3, 0x30ee, 0x49c1, [8]byte{0xac, 0xe1, 0x6b, 0x5e, 0xc3, 0x72, 0xaf, 0xb5}} + FOLDERID_SampleMusic = &KNOWNFOLDERID{0xb250c668, 0xf57d, 0x4ee1, [8]byte{0xa6, 0x3c, 0x29, 0x0e, 0xe7, 0xd1, 0xaa, 0x1f}} + FOLDERID_SamplePictures = &KNOWNFOLDERID{0xc4900540, 0x2379, 0x4c75, [8]byte{0x84, 0x4b, 0x64, 0xe6, 0xfa, 0xf8, 0x71, 0x6b}} + FOLDERID_SampleVideos = &KNOWNFOLDERID{0x859ead94, 0x2e85, 0x48ad, [8]byte{0xa7, 0x1a, 0x09, 0x69, 0xcb, 0x56, 0xa6, 0xcd}} + FOLDERID_PhotoAlbums = &KNOWNFOLDERID{0x69d2cf90, 0xfc33, 0x4fb7, [8]byte{0x9a, 0x0c, 0xeb, 0xb0, 0xf0, 0xfc, 0xb4, 0x3c}} + FOLDERID_Public = &KNOWNFOLDERID{0xdfdf76a2, 0xc82a, 0x4d63, [8]byte{0x90, 0x6a, 0x56, 0x44, 0xac, 0x45, 0x73, 0x85}} + FOLDERID_ChangeRemovePrograms = &KNOWNFOLDERID{0xdf7266ac, 0x9274, 0x4867, [8]byte{0x8d, 0x55, 0x3b, 0xd6, 0x61, 0xde, 0x87, 0x2d}} + FOLDERID_AppUpdates = &KNOWNFOLDERID{0xa305ce99, 0xf527, 0x492b, [8]byte{0x8b, 0x1a, 0x7e, 0x76, 0xfa, 0x98, 0xd6, 0xe4}} + FOLDERID_AddNewPrograms = &KNOWNFOLDERID{0xde61d971, 0x5ebc, 0x4f02, [8]byte{0xa3, 0xa9, 0x6c, 0x82, 0x89, 0x5e, 0x5c, 0x04}} + FOLDERID_Downloads = &KNOWNFOLDERID{0x374de290, 0x123f, 0x4565, [8]byte{0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b}} + FOLDERID_PublicDownloads = &KNOWNFOLDERID{0x3d644c9b, 0x1fb8, 0x4f30, [8]byte{0x9b, 0x45, 0xf6, 0x70, 0x23, 0x5f, 0x79, 0xc0}} + FOLDERID_SavedSearches = &KNOWNFOLDERID{0x7d1d3a04, 0xdebb, 0x4115, [8]byte{0x95, 0xcf, 0x2f, 0x29, 0xda, 0x29, 0x20, 0xda}} + FOLDERID_QuickLaunch = &KNOWNFOLDERID{0x52a4f021, 0x7b75, 0x48a9, [8]byte{0x9f, 0x6b, 0x4b, 0x87, 0xa2, 0x10, 0xbc, 0x8f}} + FOLDERID_Contacts = &KNOWNFOLDERID{0x56784854, 0xc6cb, 0x462b, [8]byte{0x81, 0x69, 0x88, 0xe3, 0x50, 0xac, 0xb8, 0x82}} + FOLDERID_SidebarParts = &KNOWNFOLDERID{0xa75d362e, 0x50fc, 0x4fb7, [8]byte{0xac, 0x2c, 0xa8, 0xbe, 0xaa, 0x31, 0x44, 0x93}} + FOLDERID_SidebarDefaultParts = &KNOWNFOLDERID{0x7b396e54, 0x9ec5, 0x4300, [8]byte{0xbe, 0x0a, 0x24, 0x82, 0xeb, 0xae, 0x1a, 0x26}} + FOLDERID_PublicGameTasks = &KNOWNFOLDERID{0xdebf2536, 0xe1a8, 0x4c59, [8]byte{0xb6, 0xa2, 0x41, 0x45, 0x86, 0x47, 0x6a, 0xea}} + FOLDERID_GameTasks = &KNOWNFOLDERID{0x054fae61, 0x4dd8, 0x4787, [8]byte{0x80, 0xb6, 0x09, 0x02, 0x20, 0xc4, 0xb7, 0x00}} + FOLDERID_SavedGames = &KNOWNFOLDERID{0x4c5c32ff, 0xbb9d, 0x43b0, [8]byte{0xb5, 0xb4, 0x2d, 0x72, 0xe5, 0x4e, 0xaa, 0xa4}} + FOLDERID_Games = &KNOWNFOLDERID{0xcac52c1a, 0xb53d, 0x4edc, [8]byte{0x92, 0xd7, 0x6b, 0x2e, 0x8a, 0xc1, 0x94, 0x34}} + FOLDERID_SEARCH_MAPI = &KNOWNFOLDERID{0x98ec0e18, 0x2098, 0x4d44, [8]byte{0x86, 0x44, 0x66, 0x97, 0x93, 0x15, 0xa2, 0x81}} + FOLDERID_SEARCH_CSC = &KNOWNFOLDERID{0xee32e446, 0x31ca, 0x4aba, [8]byte{0x81, 0x4f, 0xa5, 0xeb, 0xd2, 0xfd, 0x6d, 0x5e}} + FOLDERID_Links = &KNOWNFOLDERID{0xbfb9d5e0, 0xc6a9, 0x404c, [8]byte{0xb2, 0xb2, 0xae, 0x6d, 0xb6, 0xaf, 0x49, 0x68}} + FOLDERID_UsersFiles = &KNOWNFOLDERID{0xf3ce0f7c, 0x4901, 0x4acc, [8]byte{0x86, 0x48, 0xd5, 0xd4, 0x4b, 0x04, 0xef, 0x8f}} + FOLDERID_UsersLibraries = &KNOWNFOLDERID{0xa302545d, 0xdeff, 0x464b, [8]byte{0xab, 0xe8, 0x61, 0xc8, 0x64, 0x8d, 0x93, 0x9b}} + FOLDERID_SearchHome = &KNOWNFOLDERID{0x190337d1, 0xb8ca, 0x4121, [8]byte{0xa6, 0x39, 0x6d, 0x47, 0x2d, 0x16, 0x97, 0x2a}} + FOLDERID_OriginalImages = &KNOWNFOLDERID{0x2c36c0aa, 0x5812, 0x4b87, [8]byte{0xbf, 0xd0, 0x4c, 0xd0, 0xdf, 0xb1, 0x9b, 0x39}} + FOLDERID_DocumentsLibrary = &KNOWNFOLDERID{0x7b0db17d, 0x9cd2, 0x4a93, [8]byte{0x97, 0x33, 0x46, 0xcc, 0x89, 0x02, 0x2e, 0x7c}} + FOLDERID_MusicLibrary = &KNOWNFOLDERID{0x2112ab0a, 0xc86a, 0x4ffe, [8]byte{0xa3, 0x68, 0x0d, 0xe9, 0x6e, 0x47, 0x01, 0x2e}} + FOLDERID_PicturesLibrary = &KNOWNFOLDERID{0xa990ae9f, 0xa03b, 0x4e80, [8]byte{0x94, 0xbc, 0x99, 0x12, 0xd7, 0x50, 0x41, 0x04}} + FOLDERID_VideosLibrary = &KNOWNFOLDERID{0x491e922f, 0x5643, 0x4af4, [8]byte{0xa7, 0xeb, 0x4e, 0x7a, 0x13, 0x8d, 0x81, 0x74}} + FOLDERID_RecordedTVLibrary = &KNOWNFOLDERID{0x1a6fdba2, 0xf42d, 0x4358, [8]byte{0xa7, 0x98, 0xb7, 0x4d, 0x74, 0x59, 0x26, 0xc5}} + FOLDERID_HomeGroup = &KNOWNFOLDERID{0x52528a6b, 0xb9e3, 0x4add, [8]byte{0xb6, 0x0d, 0x58, 0x8c, 0x2d, 0xba, 0x84, 0x2d}} + FOLDERID_HomeGroupCurrentUser = &KNOWNFOLDERID{0x9b74b6a3, 0x0dfd, 0x4f11, [8]byte{0x9e, 0x78, 0x5f, 0x78, 0x00, 0xf2, 0xe7, 0x72}} + FOLDERID_DeviceMetadataStore = &KNOWNFOLDERID{0x5ce4a5e9, 0xe4eb, 0x479d, [8]byte{0xb8, 0x9f, 0x13, 0x0c, 0x02, 0x88, 0x61, 0x55}} + FOLDERID_Libraries = &KNOWNFOLDERID{0x1b3ea5dc, 0xb587, 0x4786, [8]byte{0xb4, 0xef, 0xbd, 0x1d, 0xc3, 0x32, 0xae, 0xae}} + FOLDERID_PublicLibraries = &KNOWNFOLDERID{0x48daf80b, 0xe6cf, 0x4f4e, [8]byte{0xb8, 0x00, 0x0e, 0x69, 0xd8, 0x4e, 0xe3, 0x84}} + FOLDERID_UserPinned = &KNOWNFOLDERID{0x9e3995ab, 0x1f9c, 0x4f13, [8]byte{0xb8, 0x27, 0x48, 0xb2, 0x4b, 0x6c, 0x71, 0x74}} + FOLDERID_ImplicitAppShortcuts = &KNOWNFOLDERID{0xbcb5256f, 0x79f6, 0x4cee, [8]byte{0xb7, 0x25, 0xdc, 0x34, 0xe4, 0x02, 0xfd, 0x46}} + FOLDERID_AccountPictures = &KNOWNFOLDERID{0x008ca0b1, 0x55b4, 0x4c56, [8]byte{0xb8, 0xa8, 0x4d, 0xe4, 0xb2, 0x99, 0xd3, 0xbe}} + FOLDERID_PublicUserTiles = &KNOWNFOLDERID{0x0482af6c, 0x08f1, 0x4c34, [8]byte{0x8c, 0x90, 0xe1, 0x7e, 0xc9, 0x8b, 0x1e, 0x17}} + FOLDERID_AppsFolder = &KNOWNFOLDERID{0x1e87508d, 0x89c2, 0x42f0, [8]byte{0x8a, 0x7e, 0x64, 0x5a, 0x0f, 0x50, 0xca, 0x58}} + FOLDERID_StartMenuAllPrograms = &KNOWNFOLDERID{0xf26305ef, 0x6948, 0x40b9, [8]byte{0xb2, 0x55, 0x81, 0x45, 0x3d, 0x09, 0xc7, 0x85}} + FOLDERID_CommonStartMenuPlaces = &KNOWNFOLDERID{0xa440879f, 0x87a0, 0x4f7d, [8]byte{0xb7, 0x00, 0x02, 0x07, 0xb9, 0x66, 0x19, 0x4a}} + FOLDERID_ApplicationShortcuts = &KNOWNFOLDERID{0xa3918781, 0xe5f2, 0x4890, [8]byte{0xb3, 0xd9, 0xa7, 0xe5, 0x43, 0x32, 0x32, 0x8c}} + FOLDERID_RoamingTiles = &KNOWNFOLDERID{0x00bcfc5a, 0xed94, 0x4e48, [8]byte{0x96, 0xa1, 0x3f, 0x62, 0x17, 0xf2, 0x19, 0x90}} + FOLDERID_RoamedTileImages = &KNOWNFOLDERID{0xaaa8d5a5, 0xf1d6, 0x4259, [8]byte{0xba, 0xa8, 0x78, 0xe7, 0xef, 0x60, 0x83, 0x5e}} + FOLDERID_Screenshots = &KNOWNFOLDERID{0xb7bede81, 0xdf94, 0x4682, [8]byte{0xa7, 0xd8, 0x57, 0xa5, 0x26, 0x20, 0xb8, 0x6f}} + FOLDERID_CameraRoll = &KNOWNFOLDERID{0xab5fb87b, 0x7ce2, 0x4f83, [8]byte{0x91, 0x5d, 0x55, 0x08, 0x46, 0xc9, 0x53, 0x7b}} + FOLDERID_SkyDrive = &KNOWNFOLDERID{0xa52bba46, 0xe9e1, 0x435f, [8]byte{0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6}} + FOLDERID_OneDrive = &KNOWNFOLDERID{0xa52bba46, 0xe9e1, 0x435f, [8]byte{0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6}} + FOLDERID_SkyDriveDocuments = &KNOWNFOLDERID{0x24d89e24, 0x2f19, 0x4534, [8]byte{0x9d, 0xde, 0x6a, 0x66, 0x71, 0xfb, 0xb8, 0xfe}} + FOLDERID_SkyDrivePictures = &KNOWNFOLDERID{0x339719b5, 0x8c47, 0x4894, [8]byte{0x94, 0xc2, 0xd8, 0xf7, 0x7a, 0xdd, 0x44, 0xa6}} + FOLDERID_SkyDriveMusic = &KNOWNFOLDERID{0xc3f2459e, 0x80d6, 0x45dc, [8]byte{0xbf, 0xef, 0x1f, 0x76, 0x9f, 0x2b, 0xe7, 0x30}} + FOLDERID_SkyDriveCameraRoll = &KNOWNFOLDERID{0x767e6811, 0x49cb, 0x4273, [8]byte{0x87, 0xc2, 0x20, 0xf3, 0x55, 0xe1, 0x08, 0x5b}} + FOLDERID_SearchHistory = &KNOWNFOLDERID{0x0d4c3db6, 0x03a3, 0x462f, [8]byte{0xa0, 0xe6, 0x08, 0x92, 0x4c, 0x41, 0xb5, 0xd4}} + FOLDERID_SearchTemplates = &KNOWNFOLDERID{0x7e636bfe, 0xdfa9, 0x4d5e, [8]byte{0xb4, 0x56, 0xd7, 0xb3, 0x98, 0x51, 0xd8, 0xa9}} + FOLDERID_CameraRollLibrary = &KNOWNFOLDERID{0x2b20df75, 0x1eda, 0x4039, [8]byte{0x80, 0x97, 0x38, 0x79, 0x82, 0x27, 0xd5, 0xb7}} + FOLDERID_SavedPictures = &KNOWNFOLDERID{0x3b193882, 0xd3ad, 0x4eab, [8]byte{0x96, 0x5a, 0x69, 0x82, 0x9d, 0x1f, 0xb5, 0x9f}} + FOLDERID_SavedPicturesLibrary = &KNOWNFOLDERID{0xe25b5812, 0xbe88, 0x4bd9, [8]byte{0x94, 0xb0, 0x29, 0x23, 0x34, 0x77, 0xb6, 0xc3}} + FOLDERID_RetailDemo = &KNOWNFOLDERID{0x12d4c69e, 0x24ad, 0x4923, [8]byte{0xbe, 0x19, 0x31, 0x32, 0x1c, 0x43, 0xa7, 0x67}} + FOLDERID_Device = &KNOWNFOLDERID{0x1c2ac1dc, 0x4358, 0x4b6c, [8]byte{0x97, 0x33, 0xaf, 0x21, 0x15, 0x65, 0x76, 0xf0}} + FOLDERID_DevelopmentFiles = &KNOWNFOLDERID{0xdbe8e08e, 0x3053, 0x4bbc, [8]byte{0xb1, 0x83, 0x2a, 0x7b, 0x2b, 0x19, 0x1e, 0x59}} + FOLDERID_Objects3D = &KNOWNFOLDERID{0x31c0dd25, 0x9439, 0x4f12, [8]byte{0xbf, 0x41, 0x7f, 0xf4, 0xed, 0xa3, 0x87, 0x22}} + FOLDERID_AppCaptures = &KNOWNFOLDERID{0xedc0fe71, 0x98d8, 0x4f4a, [8]byte{0xb9, 0x20, 0xc8, 0xdc, 0x13, 0x3c, 0xb1, 0x65}} + FOLDERID_LocalDocuments = &KNOWNFOLDERID{0xf42ee2d3, 0x909f, 0x4907, [8]byte{0x88, 0x71, 0x4c, 0x22, 0xfc, 0x0b, 0xf7, 0x56}} + FOLDERID_LocalPictures = &KNOWNFOLDERID{0x0ddd015d, 0xb06c, 0x45d5, [8]byte{0x8c, 0x4c, 0xf5, 0x97, 0x13, 0x85, 0x46, 0x39}} + FOLDERID_LocalVideos = &KNOWNFOLDERID{0x35286a68, 0x3c57, 0x41a1, [8]byte{0xbb, 0xb1, 0x0e, 0xae, 0x73, 0xd7, 0x6c, 0x95}} + FOLDERID_LocalMusic = &KNOWNFOLDERID{0xa0c69a99, 0x21c8, 0x4671, [8]byte{0x87, 0x03, 0x79, 0x34, 0x16, 0x2f, 0xcf, 0x1d}} + FOLDERID_LocalDownloads = &KNOWNFOLDERID{0x7d83ee9b, 0x2244, 0x4e70, [8]byte{0xb1, 0xf5, 0x53, 0x93, 0x04, 0x2a, 0xf1, 0xe4}} + FOLDERID_RecordedCalls = &KNOWNFOLDERID{0x2f8b40c2, 0x83ed, 0x48ee, [8]byte{0xb3, 0x83, 0xa1, 0xf1, 0x57, 0xec, 0x6f, 0x9a}} + FOLDERID_AllAppMods = &KNOWNFOLDERID{0x7ad67899, 0x66af, 0x43ba, [8]byte{0x91, 0x56, 0x6a, 0xad, 0x42, 0xe6, 0xc5, 0x96}} + FOLDERID_CurrentAppMods = &KNOWNFOLDERID{0x3db40b20, 0x2a30, 0x4dbe, [8]byte{0x91, 0x7e, 0x77, 0x1d, 0xd2, 0x1d, 0xd0, 0x99}} + FOLDERID_AppDataDesktop = &KNOWNFOLDERID{0xb2c5e279, 0x7add, 0x439f, [8]byte{0xb2, 0x8c, 0xc4, 0x1f, 0xe1, 0xbb, 0xf6, 0x72}} + FOLDERID_AppDataDocuments = &KNOWNFOLDERID{0x7be16610, 0x1f7f, 0x44ac, [8]byte{0xbf, 0xf0, 0x83, 0xe1, 0x5f, 0x2f, 0xfc, 0xa1}} + FOLDERID_AppDataFavorites = &KNOWNFOLDERID{0x7cfbefbc, 0xde1f, 0x45aa, [8]byte{0xb8, 0x43, 0xa5, 0x42, 0xac, 0x53, 0x6c, 0xc9}} + FOLDERID_AppDataProgramData = &KNOWNFOLDERID{0x559d40a3, 0xa036, 0x40fa, [8]byte{0xaf, 0x61, 0x84, 0xcb, 0x43, 0x0a, 0x4d, 0x34}} +) diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 2a0f39698..d461bed98 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -37,10 +37,13 @@ func errnoErr(e syscall.Errno) error { var ( modadvapi32 = NewLazySystemDLL("advapi32.dll") modkernel32 = NewLazySystemDLL("kernel32.dll") - moduserenv = NewLazySystemDLL("userenv.dll") modshell32 = NewLazySystemDLL("shell32.dll") + moduserenv = NewLazySystemDLL("userenv.dll") modmswsock = NewLazySystemDLL("mswsock.dll") modcrypt32 = NewLazySystemDLL("crypt32.dll") + moduser32 = NewLazySystemDLL("user32.dll") + modole32 = NewLazySystemDLL("ole32.dll") + modntdll = NewLazySystemDLL("ntdll.dll") modws2_32 = NewLazySystemDLL("ws2_32.dll") moddnsapi = NewLazySystemDLL("dnsapi.dll") modiphlpapi = NewLazySystemDLL("iphlpapi.dll") @@ -58,6 +61,7 @@ var ( procDeleteService = modadvapi32.NewProc("DeleteService") procStartServiceW = modadvapi32.NewProc("StartServiceW") procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus") + procQueryServiceLockStatusW = modadvapi32.NewProc("QueryServiceLockStatusW") procControlService = modadvapi32.NewProc("ControlService") procStartServiceCtrlDispatcherW = modadvapi32.NewProc("StartServiceCtrlDispatcherW") procSetServiceStatus = modadvapi32.NewProc("SetServiceStatus") @@ -76,6 +80,7 @@ var ( procGetVersion = modkernel32.NewProc("GetVersion") procFormatMessageW = modkernel32.NewProc("FormatMessageW") procExitProcess = modkernel32.NewProc("ExitProcess") + procIsWow64Process = modkernel32.NewProc("IsWow64Process") procCreateFileW = modkernel32.NewProc("CreateFileW") procReadFile = modkernel32.NewProc("ReadFile") procWriteFile = modkernel32.NewProc("WriteFile") @@ -109,6 +114,8 @@ var ( procCancelIoEx = modkernel32.NewProc("CancelIoEx") procCreateProcessW = modkernel32.NewProc("CreateProcessW") procOpenProcess = modkernel32.NewProc("OpenProcess") + procShellExecuteW = modshell32.NewProc("ShellExecuteW") + procSHGetKnownFolderPath = modshell32.NewProc("SHGetKnownFolderPath") procTerminateProcess = modkernel32.NewProc("TerminateProcess") procGetExitCodeProcess = modkernel32.NewProc("GetExitCodeProcess") procGetStartupInfoW = modkernel32.NewProc("GetStartupInfoW") @@ -130,6 +137,7 @@ var ( procSetEnvironmentVariableW = modkernel32.NewProc("SetEnvironmentVariableW") procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") + procGetTickCount64 = modkernel32.NewProc("GetTickCount64") procSetFileTime = modkernel32.NewProc("SetFileTime") procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW") procSetFileAttributesW = modkernel32.NewProc("SetFileAttributesW") @@ -177,6 +185,8 @@ var ( procCreateToolhelp32Snapshot = modkernel32.NewProc("CreateToolhelp32Snapshot") procProcess32FirstW = modkernel32.NewProc("Process32FirstW") procProcess32NextW = modkernel32.NewProc("Process32NextW") + procThread32First = modkernel32.NewProc("Thread32First") + procThread32Next = modkernel32.NewProc("Thread32Next") procDeviceIoControl = modkernel32.NewProc("DeviceIoControl") procCreateSymbolicLinkW = modkernel32.NewProc("CreateSymbolicLinkW") procCreateHardLinkW = modkernel32.NewProc("CreateHardLinkW") @@ -188,6 +198,17 @@ var ( procResetEvent = modkernel32.NewProc("ResetEvent") procPulseEvent = modkernel32.NewProc("PulseEvent") procSleepEx = modkernel32.NewProc("SleepEx") + procCreateJobObjectW = modkernel32.NewProc("CreateJobObjectW") + procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") + procTerminateJobObject = modkernel32.NewProc("TerminateJobObject") + procSetErrorMode = modkernel32.NewProc("SetErrorMode") + procResumeThread = modkernel32.NewProc("ResumeThread") + procSetPriorityClass = modkernel32.NewProc("SetPriorityClass") + procGetPriorityClass = modkernel32.NewProc("GetPriorityClass") + procSetInformationJobObject = modkernel32.NewProc("SetInformationJobObject") + procGenerateConsoleCtrlEvent = modkernel32.NewProc("GenerateConsoleCtrlEvent") + procGetProcessId = modkernel32.NewProc("GetProcessId") + procOpenThread = modkernel32.NewProc("OpenThread") procDefineDosDeviceW = modkernel32.NewProc("DefineDosDeviceW") procDeleteVolumeMountPointW = modkernel32.NewProc("DeleteVolumeMountPointW") procFindFirstVolumeW = modkernel32.NewProc("FindFirstVolumeW") @@ -207,6 +228,12 @@ var ( procQueryDosDeviceW = modkernel32.NewProc("QueryDosDeviceW") procSetVolumeLabelW = modkernel32.NewProc("SetVolumeLabelW") procSetVolumeMountPointW = modkernel32.NewProc("SetVolumeMountPointW") + procMessageBoxW = moduser32.NewProc("MessageBoxW") + procCLSIDFromString = modole32.NewProc("CLSIDFromString") + procStringFromGUID2 = modole32.NewProc("StringFromGUID2") + procCoCreateGuid = modole32.NewProc("CoCreateGuid") + procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") + procRtlGetVersion = modntdll.NewProc("RtlGetVersion") procWSAStartup = modws2_32.NewProc("WSAStartup") procWSACleanup = modws2_32.NewProc("WSACleanup") procWSAIoctl = modws2_32.NewProc("WSAIoctl") @@ -255,8 +282,13 @@ var ( procCopySid = modadvapi32.NewProc("CopySid") procAllocateAndInitializeSid = modadvapi32.NewProc("AllocateAndInitializeSid") procCreateWellKnownSid = modadvapi32.NewProc("CreateWellKnownSid") + procIsWellKnownSid = modadvapi32.NewProc("IsWellKnownSid") procFreeSid = modadvapi32.NewProc("FreeSid") procEqualSid = modadvapi32.NewProc("EqualSid") + procGetSidIdentifierAuthority = modadvapi32.NewProc("GetSidIdentifierAuthority") + procGetSidSubAuthorityCount = modadvapi32.NewProc("GetSidSubAuthorityCount") + procGetSidSubAuthority = modadvapi32.NewProc("GetSidSubAuthority") + procIsValidSid = modadvapi32.NewProc("IsValidSid") procCheckTokenMembership = modadvapi32.NewProc("CheckTokenMembership") procOpenProcessToken = modadvapi32.NewProc("OpenProcessToken") procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") @@ -400,6 +432,18 @@ func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { return } +func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procQueryServiceLockStatusW.Addr(), 4, uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) { r1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) if r1 == 0 { @@ -637,6 +681,18 @@ func ExitProcess(exitcode uint32) { return } +func IsWow64Process(handle Handle, isWow64 *bool) (err error) { + r1, _, e1 := syscall.Syscall(procIsWow64Process.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(isWow64)), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle 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 = Handle(r0) @@ -1034,14 +1090,14 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA return } -func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err error) { +func OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) { var _p0 uint32 if inheritHandle { _p0 = 1 } else { _p0 = 0 } - r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(da), uintptr(_p0), uintptr(pid)) + r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(processId)) handle = Handle(r0) if handle == 0 { if e1 != 0 { @@ -1053,6 +1109,26 @@ func OpenProcess(da uint32, inheritHandle bool, pid uint32) (handle Handle, err return } +func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) { + r1, _, e1 := syscall.Syscall6(procShellExecuteW.Addr(), 6, uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd)) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) { + r0, _, _ := syscall.Syscall6(procSHGetKnownFolderPath.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path)), 0, 0) + if r0 != 0 { + ret = syscall.Errno(r0) + } + return +} + func TerminateProcess(handle Handle, exitcode uint32) (err error) { r1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0) if r1 == 0 { @@ -1331,6 +1407,12 @@ func DestroyEnvironmentBlock(block *uint16) (err error) { return } +func getTickCount64() (ms uint64) { + r0, _, _ := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0) + ms = uint64(r0) + return +} + func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { r1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0) if r1 == 0 { @@ -1773,7 +1855,7 @@ func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32 return } -func getCurrentProcessId() (pid uint32) { +func GetCurrentProcessId() (pid uint32) { r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0) pid = uint32(r0) return @@ -1876,6 +1958,30 @@ func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { return } +func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { + r1, _, e1 := syscall.Syscall(procThread32First.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { + r1, _, e1 := syscall.Syscall(procThread32Next.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) { r1, _, e1 := syscall.Syscall9(procDeviceIoControl.Addr(), 8, uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)), 0) if r1 == 0 { @@ -2011,6 +2117,144 @@ func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { return } +func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) { + r0, _, e1 := syscall.Syscall(procCreateJobObjectW.Addr(), 2, uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name)), 0) + handle = Handle(r0) + if handle == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func AssignProcessToJobObject(job Handle, process Handle) (err error) { + r1, _, e1 := syscall.Syscall(procAssignProcessToJobObject.Addr(), 2, uintptr(job), uintptr(process), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func TerminateJobObject(job Handle, exitCode uint32) (err error) { + r1, _, e1 := syscall.Syscall(procTerminateJobObject.Addr(), 2, uintptr(job), uintptr(exitCode), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func SetErrorMode(mode uint32) (ret uint32) { + r0, _, _ := syscall.Syscall(procSetErrorMode.Addr(), 1, uintptr(mode), 0, 0) + ret = uint32(r0) + return +} + +func ResumeThread(thread Handle) (ret uint32, err error) { + r0, _, e1 := syscall.Syscall(procResumeThread.Addr(), 1, uintptr(thread), 0, 0) + ret = uint32(r0) + if ret == 0xffffffff { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func SetPriorityClass(process Handle, priorityClass uint32) (err error) { + r1, _, e1 := syscall.Syscall(procSetPriorityClass.Addr(), 2, uintptr(process), uintptr(priorityClass), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func GetPriorityClass(process Handle) (ret uint32, err error) { + r0, _, e1 := syscall.Syscall(procGetPriorityClass.Addr(), 1, uintptr(process), 0, 0) + ret = uint32(r0) + if ret == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) { + r0, _, e1 := syscall.Syscall6(procSetInformationJobObject.Addr(), 4, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), 0, 0) + ret = int(r0) + if ret == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) { + r1, _, e1 := syscall.Syscall(procGenerateConsoleCtrlEvent.Addr(), 2, uintptr(ctrlEvent), uintptr(processGroupID), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func GetProcessId(process Handle) (id uint32, err error) { + r0, _, e1 := syscall.Syscall(procGetProcessId.Addr(), 1, uintptr(process), 0, 0) + id = uint32(r0) + if id == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (handle Handle, err error) { + var _p0 uint32 + if inheritHandle { + _p0 = 1 + } else { + _p0 = 0 + } + r0, _, e1 := syscall.Syscall(procOpenThread.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(threadId)) + handle = Handle(r0) + if handle == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) { r1, _, e1 := syscall.Syscall(procDefineDosDeviceW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) if r1 == 0 { @@ -2238,6 +2482,54 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro return } +func MessageBox(hwnd Handle, 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) + if ret == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { + r0, _, _ := syscall.Syscall(procCLSIDFromString.Addr(), 2, uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid)), 0) + if r0 != 0 { + ret = syscall.Errno(r0) + } + return +} + +func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { + r0, _, _ := syscall.Syscall(procStringFromGUID2.Addr(), 3, uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) + chars = int32(r0) + return +} + +func coCreateGuid(pguid *GUID) (ret error) { + r0, _, _ := syscall.Syscall(procCoCreateGuid.Addr(), 1, uintptr(unsafe.Pointer(pguid)), 0, 0) + if r0 != 0 { + ret = syscall.Errno(r0) + } + return +} + +func CoTaskMemFree(address unsafe.Pointer) { + syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(address), 0, 0) + return +} + +func rtlGetVersion(info *OsVersionInfoEx) (ret error) { + r0, _, _ := syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(info)), 0, 0) + if r0 != 0 { + ret = syscall.Errno(r0) + } + return +} + func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0) if r0 != 0 { @@ -2780,6 +3072,12 @@ func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, s return } +func isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) { + r0, _, _ := syscall.Syscall(procIsWellKnownSid.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(sidType), 0) + isWellKnown = r0 != 0 + return +} + func FreeSid(sid *SID) (err error) { r1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) if r1 != 0 { @@ -2798,6 +3096,30 @@ func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) { return } +func getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) { + r0, _, _ := syscall.Syscall(procGetSidIdentifierAuthority.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + authority = (*SidIdentifierAuthority)(unsafe.Pointer(r0)) + return +} + +func getSidSubAuthorityCount(sid *SID) (count *uint8) { + r0, _, _ := syscall.Syscall(procGetSidSubAuthorityCount.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + count = (*uint8)(unsafe.Pointer(r0)) + return +} + +func getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) { + r0, _, _ := syscall.Syscall(procGetSidSubAuthority.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(index), 0) + subAuthority = (*uint32)(unsafe.Pointer(r0)) + return +} + +func isValidSid(sid *SID) (isValid bool) { + r0, _, _ := syscall.Syscall(procIsValidSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + isValid = r0 != 0 + return +} + func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) { r1, _, e1 := syscall.Syscall(procCheckTokenMembership.Addr(), 3, uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) if r1 == 0 { diff --git a/vendor/github.com/appscode/jsonpatch/LICENSE b/vendor/gomodules.xyz/jsonpatch/v2/LICENSE similarity index 100% rename from vendor/github.com/appscode/jsonpatch/LICENSE rename to vendor/gomodules.xyz/jsonpatch/v2/LICENSE diff --git a/vendor/gomodules.xyz/jsonpatch/v2/go.mod b/vendor/gomodules.xyz/jsonpatch/v2/go.mod new file mode 100644 index 000000000..b5eaf830e --- /dev/null +++ b/vendor/gomodules.xyz/jsonpatch/v2/go.mod @@ -0,0 +1,9 @@ +module gomodules.xyz/jsonpatch/v2 + +go 1.12 + +require ( + github.com/evanphx/json-patch v4.5.0+incompatible + github.com/pkg/errors v0.8.1 // indirect + github.com/stretchr/testify v1.3.0 +) diff --git a/vendor/gomodules.xyz/jsonpatch/v2/go.sum b/vendor/gomodules.xyz/jsonpatch/v2/go.sum new file mode 100644 index 000000000..d8f9ffe1c --- /dev/null +++ b/vendor/gomodules.xyz/jsonpatch/v2/go.sum @@ -0,0 +1,11 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/vendor/github.com/appscode/jsonpatch/jsonpatch.go b/vendor/gomodules.xyz/jsonpatch/v2/jsonpatch.go similarity index 97% rename from vendor/github.com/appscode/jsonpatch/jsonpatch.go rename to vendor/gomodules.xyz/jsonpatch/v2/jsonpatch.go index 3e698949e..e7cb7d6da 100644 --- a/vendor/github.com/appscode/jsonpatch/jsonpatch.go +++ b/vendor/gomodules.xyz/jsonpatch/v2/jsonpatch.go @@ -58,8 +58,8 @@ func NewPatch(operation, path string, value interface{}) Operation { // // An error will be returned if any of the two documents are invalid. func CreatePatch(a, b []byte) ([]Operation, error) { - aI := map[string]interface{}{} - bI := map[string]interface{}{} + var aI interface{} + var bI interface{} err := json.Unmarshal(a, &aI) if err != nil { return nil, errBadJSONDoc @@ -68,7 +68,7 @@ func CreatePatch(a, b []byte) ([]Operation, error) { if err != nil { return nil, errBadJSONDoc } - return diff(aI, bI, "", []Operation{}) + return handleValues(aI, bI, "", []Operation{}) } // Returns true if the values matches (must be json types) @@ -326,7 +326,7 @@ func backtrace(s, t []interface{}, p string, i int, j int, matrix [][]int) []Ope return append([]Operation{op}, backtrace(s, t, p, i-1, j-1, matrix)...) } - p2, _ := handleValues(s[j-1], t[j-1], makePath(p, i-1), []Operation{}) + p2, _ := handleValues(s[i-1], t[j-1], makePath(p, i-1), []Operation{}) return append(p2, backtrace(s, t, p, i-1, j-1, matrix)...) } if i > 0 && j > 0 && matrix[i-1][j-1] == matrix[i][j] { diff --git a/vendor/google.golang.org/appengine/README.md b/vendor/google.golang.org/appengine/README.md index 4376a3765..9fdbacd3c 100644 --- a/vendor/google.golang.org/appengine/README.md +++ b/vendor/google.golang.org/appengine/README.md @@ -79,11 +79,11 @@ The `EnableKeyConversion` enables automatic conversion from a key encoded with c ### Enabling key conversion -Enable key conversion by calling `EnableKeyConversion(ctx)` in the `/_ah/startup` handler for basic and manual scaling or any handler in automatic scaling. +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 startup handler will enable key conversion for all handlers in the service. +This start handler will enable key conversion for all handlers in the service. ``` http.HandleFunc("/_ah/start", func(w http.ResponseWriter, r *http.Request) { diff --git a/vendor/google.golang.org/appengine/go.mod b/vendor/google.golang.org/appengine/go.mod index f449359d2..451592798 100644 --- a/vendor/google.golang.org/appengine/go.mod +++ b/vendor/google.golang.org/appengine/go.mod @@ -1,7 +1,10 @@ module google.golang.org/appengine require ( - github.com/golang/protobuf v1.2.0 - golang.org/x/net v0.0.0-20180724234803-3673e40ba225 - golang.org/x/text v0.3.0 + github.com/golang/protobuf v1.3.1 + golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 // indirect + golang.org/x/net v0.0.0-20190603091049-60506f45cf65 + golang.org/x/sys v0.0.0-20190606165138-5da285871e9c // indirect + golang.org/x/text v0.3.2 + golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b // indirect ) diff --git a/vendor/google.golang.org/appengine/go.sum b/vendor/google.golang.org/appengine/go.sum index 1a221c089..cb3232556 100644 --- a/vendor/google.golang.org/appengine/go.sum +++ b/vendor/google.golang.org/appengine/go.sum @@ -1,6 +1,22 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20180724234803-3673e40ba225 h1:kNX+jCowfMYzvlSvJu5pQWEmyWFrBXJ3PBy10xKMXK8= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= diff --git a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go index 08f5b8d6f..5b6c587a9 100644 --- a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go @@ -1,12 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/api/httpbody.proto -package httpbody // import "google.golang.org/genproto/googleapis/api/httpbody" +package httpbody -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import any "github.com/golang/protobuf/ptypes/any" +import ( + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -17,7 +20,7 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or @@ -75,16 +78,17 @@ func (m *HttpBody) Reset() { *m = HttpBody{} } func (m *HttpBody) String() string { return proto.CompactTextString(m) } func (*HttpBody) ProtoMessage() {} func (*HttpBody) Descriptor() ([]byte, []int) { - return fileDescriptor_httpbody_b1715ad6d52ffa1f, []int{0} + return fileDescriptor_09ea2ecaa32a0070, []int{0} } + func (m *HttpBody) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HttpBody.Unmarshal(m, b) } func (m *HttpBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HttpBody.Marshal(b, m, deterministic) } -func (dst *HttpBody) XXX_Merge(src proto.Message) { - xxx_messageInfo_HttpBody.Merge(dst, src) +func (m *HttpBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_HttpBody.Merge(m, src) } func (m *HttpBody) XXX_Size() int { return xxx_messageInfo_HttpBody.Size(m) @@ -120,9 +124,9 @@ func init() { proto.RegisterType((*HttpBody)(nil), "google.api.HttpBody") } -func init() { proto.RegisterFile("google/api/httpbody.proto", fileDescriptor_httpbody_b1715ad6d52ffa1f) } +func init() { proto.RegisterFile("google/api/httpbody.proto", fileDescriptor_09ea2ecaa32a0070) } -var fileDescriptor_httpbody_b1715ad6d52ffa1f = []byte{ +var fileDescriptor_09ea2ecaa32a0070 = []byte{ // 229 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0x31, 0x4f, 0xc3, 0x30, 0x10, 0x85, 0xe5, 0xb6, 0x42, 0x70, 0x2d, 0x0c, 0x16, 0x43, 0x60, 0x0a, 0x4c, 0x99, 0x6c, 0x09, diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go index a203bd452..0b9907f89 100644 --- a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go +++ b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -1,12 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/rpc/status.proto -package status // import "google.golang.org/genproto/googleapis/rpc/status" +package status -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import any "github.com/golang/protobuf/ptypes/any" +import ( + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -17,7 +20,7 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // The `Status` type defines a logical error model that is suitable for // different programming environments, including REST APIs and RPC APIs. It is @@ -93,16 +96,17 @@ func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_status_8a460da8fb0891c1, []int{0} + return fileDescriptor_24d244abaf643bfe, []int{0} } + func (m *Status) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Status.Unmarshal(m, b) } func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Status.Marshal(b, m, deterministic) } -func (dst *Status) XXX_Merge(src proto.Message) { - xxx_messageInfo_Status.Merge(dst, src) +func (m *Status) XXX_Merge(src proto.Message) { + xxx_messageInfo_Status.Merge(m, src) } func (m *Status) XXX_Size() int { return xxx_messageInfo_Status.Size(m) @@ -138,9 +142,9 @@ func init() { proto.RegisterType((*Status)(nil), "google.rpc.Status") } -func init() { proto.RegisterFile("google/rpc/status.proto", fileDescriptor_status_8a460da8fb0891c1) } +func init() { proto.RegisterFile("google/rpc/status.proto", fileDescriptor_24d244abaf643bfe) } -var fileDescriptor_status_8a460da8fb0891c1 = []byte{ +var fileDescriptor_24d244abaf643bfe = []byte{ // 209 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, diff --git a/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go b/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go index 60241b8f4..a0889f0c7 100644 --- a/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go +++ b/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go @@ -1,11 +1,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/field_mask.proto -package field_mask // import "google.golang.org/genproto/protobuf/field_mask" +package field_mask -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + fmt "fmt" + math "math" + + proto "github.com/golang/protobuf/proto" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -16,7 +19,7 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // `FieldMask` represents a set of symbolic field paths, for example: // @@ -229,16 +232,17 @@ func (m *FieldMask) Reset() { *m = FieldMask{} } func (m *FieldMask) String() string { return proto.CompactTextString(m) } func (*FieldMask) ProtoMessage() {} func (*FieldMask) Descriptor() ([]byte, []int) { - return fileDescriptor_field_mask_8b509cd473f0dfb7, []int{0} + return fileDescriptor_5158202634f0da48, []int{0} } + func (m *FieldMask) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldMask.Unmarshal(m, b) } func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic) } -func (dst *FieldMask) XXX_Merge(src proto.Message) { - xxx_messageInfo_FieldMask.Merge(dst, src) +func (m *FieldMask) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldMask.Merge(m, src) } func (m *FieldMask) XXX_Size() int { return xxx_messageInfo_FieldMask.Size(m) @@ -260,11 +264,9 @@ func init() { proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask") } -func init() { - proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_field_mask_8b509cd473f0dfb7) -} +func init() { proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_5158202634f0da48) } -var fileDescriptor_field_mask_8b509cd473f0dfb7 = []byte{ +var fileDescriptor_5158202634f0da48 = []byte{ // 175 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd, diff --git a/vendor/google.golang.org/grpc/CONTRIBUTING.md b/vendor/google.golang.org/grpc/CONTRIBUTING.md index ca34e8aa0..6e69b28c2 100644 --- a/vendor/google.golang.org/grpc/CONTRIBUTING.md +++ b/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -11,22 +11,46 @@ In order to protect both you and ourselves, you will need to sign the ## Guidelines for Pull Requests How to get your contributions merged smoothly and quickly. - -- Create **small PRs** that are narrowly focused on **addressing a single concern**. We often times receive PRs that are trying to fix several things at a time, but only one fix is considered acceptable, nothing gets merged and both author's & review's time is wasted. Create more PRs to address different concerns and everyone will be happy. - -- For speculative changes, consider opening an issue and discussing it first. If you are suggesting a behavioral or API change, consider starting with a [gRFC proposal](https://github.com/grpc/proposal). - -- Provide a good **PR description** as a record of **what** change is being made and **why** it was made. Link to a github issue if it exists. - -- Don't fix code style and formatting unless you are already changing that line to address an issue. PRs with irrelevant changes won't be merged. If you do want to fix formatting or style, do that in a separate PR. - -- Unless your PR is trivial, you should expect there will be reviewer comments that you'll need to address before merging. We expect you to be reasonably responsive to those comments, otherwise the PR will be closed after 2-3 weeks of inactivity. - -- Maintain **clean commit history** and use **meaningful commit messages**. PRs with messy commit history are difficult to review and won't be merged. Use `rebase -i upstream/master` to curate your commit history and/or to bring in latest changes from master (but avoid rebasing in the middle of a code review). - -- Keep your PR up to date with upstream/master (if there are merge conflicts, we can't really merge your change). - -- **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. + +- Create **small PRs** that are narrowly focused on **addressing a single + concern**. We often times receive PRs that are trying to fix several things at + a time, but only one fix is considered acceptable, nothing gets merged and + both author's & review's time is wasted. Create more PRs to address different + concerns and everyone will be happy. + +- The grpc package should only depend on standard Go packages and a small number + of exceptions. If your contribution introduces new dependencies which are NOT + in the [list](https://godoc.org/google.golang.org/grpc?imports), you need a + discussion with gRPC-Go authors and consultants. + +- For speculative changes, consider opening an issue and discussing it first. If + you are suggesting a behavioral or API change, consider starting with a [gRFC + proposal](https://github.com/grpc/proposal). + +- Provide a good **PR description** as a record of **what** change is being made + and **why** it was made. Link to a github issue if it exists. + +- Don't fix code style and formatting unless you are already changing that line + to address an issue. PRs with irrelevant changes won't be merged. If you do + want to fix formatting or style, do that in a separate PR. + +- Unless your PR is trivial, you should expect there will be reviewer comments + that you'll need to address before merging. We expect you to be reasonably + responsive to those comments, otherwise the PR will be closed after 2-3 weeks + of inactivity. + +- Maintain **clean commit history** and use **meaningful commit messages**. PRs + with messy commit history are difficult to review and won't be merged. Use + `rebase -i upstream/master` to curate your commit history and/or to bring in + latest changes from master (but avoid rebasing in the middle of a code + review). + +- Keep your PR up to date with upstream/master (if there are merge conflicts, we + can't really merge your change). + +- **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. - `make all` to test everything, OR - `make vet` to catch vet errors - `make test` to run the tests @@ -34,4 +58,3 @@ How to get your contributions merged smoothly and quickly. - optional `make testappengine` to run tests with appengine - Exceptions to the rules can be made if there's a compelling reason for doing so. - diff --git a/vendor/google.golang.org/grpc/README.md b/vendor/google.golang.org/grpc/README.md index f5eec6717..afbc43db5 100644 --- a/vendor/google.golang.org/grpc/README.md +++ b/vendor/google.golang.org/grpc/README.md @@ -1,42 +1,96 @@ # gRPC-Go -[![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) [![GoDoc](https://godoc.org/google.golang.org/grpc?status.svg)](https://godoc.org/google.golang.org/grpc) [![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go) +[![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) +[![GoDoc](https://godoc.org/google.golang.org/grpc?status.svg)](https://godoc.org/google.golang.org/grpc) +[![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go) -The Go implementation of [gRPC](https://grpc.io/): A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the [gRPC Quick Start: Go](https://grpc.io/docs/quickstart/go.html) guide. +The Go implementation of [gRPC](https://grpc.io/): A high performance, open +source, general RPC framework that puts mobile and HTTP/2 first. For more +information see the [gRPC Quick Start: +Go](https://grpc.io/docs/quickstart/go.html) guide. Installation ------------ -To install this package, you need to install Go and setup your Go workspace on your computer. The simplest way to install the library is to run: +To install this package, you need to install Go and setup your Go workspace on +your computer. The simplest way to install the library is to run: ``` $ go get -u google.golang.org/grpc ``` +With Go module support (Go 1.11+), simply `import "google.golang.org/grpc"` in +your source code and `go [build|run|test]` will automatically download the +necessary dependencies ([Go modules +ref](https://github.com/golang/go/wiki/Modules)). + +If you are trying to access grpc-go from within China, please see the +[FAQ](#FAQ) below. + Prerequisites ------------- - gRPC-Go requires Go 1.9 or later. -Constraints ------------ -The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the [list](https://godoc.org/google.golang.org/grpc?imports), you need a discussion with gRPC-Go authors and consultants. - Documentation ------------- -See [API documentation](https://godoc.org/google.golang.org/grpc) for package and API descriptions and find examples in the [examples directory](examples/). +- See [godoc](https://godoc.org/google.golang.org/grpc) for package and API + descriptions. +- Documentation on specific topics can be found in the [Documentation + directory](Documentation/). +- Examples can be found in the [examples directory](examples/). Performance ----------- -See the current benchmarks for some of the languages supported in [this dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584&widget=490377658&container=1286539696). +Performance benchmark data for grpc-go and other languages is maintained in +[this +dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584&widget=490377658&container=1286539696). Status ------ -General Availability [Google Cloud Platform Launch Stages](https://cloud.google.com/terms/launch-stages). +General Availability [Google Cloud Platform Launch +Stages](https://cloud.google.com/terms/launch-stages). FAQ --- +#### I/O Timeout Errors + +The `golang.org` domain may be blocked from some countries. `go get` usually +produces an error like the following when this happens: + +``` +$ go get -u google.golang.org/grpc +package google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) +``` + +To build Go code, there are several options: + +- Set up a VPN and access google.golang.org through that. + +- Without Go module support: `git clone` the repo manually: + + ``` + git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc + ``` + + You will need to do the same for all of grpc's dependencies in `golang.org`, + e.g. `golang.org/x/net`. + +- With Go module support: it is possible to use the `replace` feature of `go + mod` to create aliases for golang.org packages. In your project's directory: + + ``` + go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latest + go mod tidy + go mod vendor + go build -mod=vendor + ``` + + Again, this will need to be done for all transitive dependencies hosted on + golang.org as well. Please refer to [this + issue](https://github.com/golang/go/issues/28652) in the golang repo regarding + this concern. + #### Compiling error, undefined: grpc.SupportPackageIsVersion Please update proto package, gRPC package and rebuild the proto files: diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index fafede238..4b72daa8b 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -138,6 +138,8 @@ type ClientConn interface { ResolveNow(resolver.ResolveNowOption) // Target returns the dial target for this ClientConn. + // + // Deprecated: Use the Target field in the BuildOptions instead. Target() string } @@ -155,6 +157,10 @@ type BuildOptions struct { Dialer func(context.Context, string) (net.Conn, error) // ChannelzParentID is the entity parent's channelz unique identification number. ChannelzParentID int64 + // Target contains the parsed address info of the dial target. It is the 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 } // Builder creates a balancer. diff --git a/vendor/google.golang.org/grpc/balancer_v1_wrapper.go b/vendor/google.golang.org/grpc/balancer_v1_wrapper.go index 29bda6353..66e9a44ac 100644 --- a/vendor/google.golang.org/grpc/balancer_v1_wrapper.go +++ b/vendor/google.golang.org/grpc/balancer_v1_wrapper.go @@ -20,7 +20,6 @@ package grpc import ( "context" - "strings" "sync" "google.golang.org/grpc/balancer" @@ -34,13 +33,7 @@ type balancerWrapperBuilder struct { } func (bwb *balancerWrapperBuilder) Build(cc balancer.ClientConn, opts balancer.BuildOptions) balancer.Balancer { - targetAddr := cc.Target() - targetSplitted := strings.Split(targetAddr, ":///") - if len(targetSplitted) >= 2 { - targetAddr = targetSplitted[1] - } - - bwb.b.Start(targetAddr, BalancerConfig{ + bwb.b.Start(opts.Target.Endpoint, BalancerConfig{ DialCreds: opts.DialCreds, Dialer: opts.Dialer, }) @@ -49,7 +42,7 @@ func (bwb *balancerWrapperBuilder) Build(cc balancer.ClientConn, opts balancer.B balancer: bwb.b, pickfirst: pickfirst, cc: cc, - targetAddr: targetAddr, + targetAddr: opts.Target.Endpoint, startCh: make(chan struct{}), conns: make(map[resolver.Address]balancer.SubConn), connSt: make(map[balancer.SubConn]*scState), @@ -120,7 +113,7 @@ func (bw *balancerWrapper) lbWatcher() { } for addrs := range notifyCh { - grpclog.Infof("balancerWrapper: got update addr from Notify: %v\n", addrs) + grpclog.Infof("balancerWrapper: got update addr from Notify: %v", addrs) if bw.pickfirst { var ( oldA resolver.Address diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index bd2d2b317..78e6d178a 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -137,6 +137,9 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * opt.apply(&cc.dopts) } + chainUnaryClientInterceptors(cc) + chainStreamClientInterceptors(cc) + defer func() { if err != nil { cc.Close() @@ -290,6 +293,7 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * CredsBundle: cc.dopts.copts.CredsBundle, Dialer: cc.dopts.copts.Dialer, ChannelzParentID: cc.channelzID, + Target: cc.parsedTarget, } // Build the resolver. @@ -327,6 +331,68 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * return cc, nil } +// chainUnaryClientInterceptors chains all unary client interceptors into one. +func chainUnaryClientInterceptors(cc *ClientConn) { + interceptors := cc.dopts.chainUnaryInts + // Prepend dopts.unaryInt to the chaining interceptors if it exists, since unaryInt will + // be executed before any other chained interceptors. + if cc.dopts.unaryInt != nil { + interceptors = append([]UnaryClientInterceptor{cc.dopts.unaryInt}, interceptors...) + } + var chainedInt UnaryClientInterceptor + if len(interceptors) == 0 { + chainedInt = nil + } else if len(interceptors) == 1 { + chainedInt = interceptors[0] + } else { + chainedInt = func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, invoker UnaryInvoker, opts ...CallOption) error { + return interceptors[0](ctx, method, req, reply, cc, getChainUnaryInvoker(interceptors, 0, invoker), opts...) + } + } + cc.dopts.unaryInt = chainedInt +} + +// getChainUnaryInvoker recursively generate the chained unary invoker. +func getChainUnaryInvoker(interceptors []UnaryClientInterceptor, curr int, finalInvoker UnaryInvoker) UnaryInvoker { + if curr == len(interceptors)-1 { + return finalInvoker + } + return func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error { + return interceptors[curr+1](ctx, method, req, reply, cc, getChainUnaryInvoker(interceptors, curr+1, finalInvoker), opts...) + } +} + +// chainStreamClientInterceptors chains all stream client interceptors into one. +func chainStreamClientInterceptors(cc *ClientConn) { + interceptors := cc.dopts.chainStreamInts + // Prepend dopts.streamInt to the chaining interceptors if it exists, since streamInt will + // be executed before any other chained interceptors. + if cc.dopts.streamInt != nil { + interceptors = append([]StreamClientInterceptor{cc.dopts.streamInt}, interceptors...) + } + var chainedInt StreamClientInterceptor + if len(interceptors) == 0 { + chainedInt = nil + } else if len(interceptors) == 1 { + chainedInt = interceptors[0] + } else { + chainedInt = func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) { + return interceptors[0](ctx, desc, cc, method, getChainStreamer(interceptors, 0, streamer), opts...) + } + } + cc.dopts.streamInt = chainedInt +} + +// getChainStreamer recursively generate the chained client stream constructor. +func getChainStreamer(interceptors []StreamClientInterceptor, curr int, finalStreamer Streamer) Streamer { + if curr == len(interceptors)-1 { + return finalStreamer + } + return func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { + return interceptors[curr+1](ctx, desc, cc, method, getChainStreamer(interceptors, curr+1, finalStreamer), opts...) + } +} + // connectivityStateManager keeps the connectivity.State of ClientConn. // This struct will eventually be exported so the balancers can access it. type connectivityStateManager struct { @@ -537,6 +603,7 @@ func (cc *ClientConn) updateResolverState(s resolver.State) error { } else if cc.balancerWrapper == nil { // Balancer dial option was set, and this is the first time handling // resolved addresses. Build a balancer with dopts.balancerBuilder. + cc.curBalancerName = cc.dopts.balancerBuilder.Name() cc.balancerWrapper = newCCBalancerWrapper(cc, cc.dopts.balancerBuilder, cc.balancerBuildOpts) } diff --git a/vendor/google.golang.org/grpc/codes/codes.go b/vendor/google.golang.org/grpc/codes/codes.go index d9b9d5782..02738839d 100644 --- a/vendor/google.golang.org/grpc/codes/codes.go +++ b/vendor/google.golang.org/grpc/codes/codes.go @@ -132,7 +132,8 @@ const ( // Unavailable indicates the service is currently unavailable. // This is a most likely a transient condition and may be corrected - // by retrying with a backoff. + // by retrying with a backoff. Note that it is not always safe to retry + // non-idempotent operations. // // See litmus test above for deciding between FailedPrecondition, // Aborted, and Unavailable. diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index e114fecbb..69c003159 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -39,8 +39,12 @@ import ( // dialOptions configure a Dial call. dialOptions are set by the DialOption // values passed to Dial. type dialOptions struct { - unaryInt UnaryClientInterceptor - streamInt StreamClientInterceptor + unaryInt UnaryClientInterceptor + streamInt StreamClientInterceptor + + chainUnaryInts []UnaryClientInterceptor + chainStreamInts []StreamClientInterceptor + cp Compressor dc Decompressor bs backoff.Strategy @@ -414,6 +418,17 @@ func WithUnaryInterceptor(f UnaryClientInterceptor) DialOption { }) } +// WithChainUnaryInterceptor returns a DialOption that specifies the chained +// interceptor for unary RPCs. The first interceptor will be the outer most, +// while the last interceptor will be the inner most wrapper around the real call. +// All interceptors added by this method will be chained, and the interceptor +// defined by WithUnaryInterceptor will always be prepended to the chain. +func WithChainUnaryInterceptor(interceptors ...UnaryClientInterceptor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.chainUnaryInts = append(o.chainUnaryInts, interceptors...) + }) +} + // WithStreamInterceptor returns a DialOption that specifies the interceptor for // streaming RPCs. func WithStreamInterceptor(f StreamClientInterceptor) DialOption { @@ -422,6 +437,17 @@ func WithStreamInterceptor(f StreamClientInterceptor) DialOption { }) } +// WithChainStreamInterceptor returns a DialOption that specifies the chained +// interceptor for unary RPCs. The first interceptor will be the outer most, +// while the last interceptor will be the inner most wrapper around the real call. +// All interceptors added by this method will be chained, and the interceptor +// defined by WithStreamInterceptor will always be prepended to the chain. +func WithChainStreamInterceptor(interceptors ...StreamClientInterceptor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.chainStreamInts = append(o.chainStreamInts, interceptors...) + }) +} + // WithAuthority returns a DialOption that specifies the value to be used as the // :authority pseudo-header. This value only works with WithInsecure and has no // effect if TransportCredentials are present. @@ -440,12 +466,12 @@ func WithChannelzParentID(id int64) DialOption { }) } -// WithDisableServiceConfig returns a DialOption that causes grpc to ignore any +// WithDisableServiceConfig returns a DialOption that causes gRPC to ignore any // service config provided by the resolver and provides a hint to the resolver // to not fetch service configs. // -// Note that, this dial option only disables service config from resolver. If -// default service config is provided, grpc will use the default service config. +// Note that this dial option only disables service config from resolver. If +// default service config is provided, gRPC will use the default service config. func WithDisableServiceConfig() DialOption { return newFuncDialOption(func(o *dialOptions) { o.disableServiceConfig = true diff --git a/vendor/google.golang.org/grpc/go.mod b/vendor/google.golang.org/grpc/go.mod index 9f3ef3a53..b75c069aa 100644 --- a/vendor/google.golang.org/grpc/go.mod +++ b/vendor/google.golang.org/grpc/go.mod @@ -7,6 +7,7 @@ require ( github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/mock v1.1.1 github.com/golang/protobuf v1.2.0 + github.com/google/go-cmp v0.2.0 golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 golang.org/x/net v0.0.0-20190311183353-d8887717615a golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be diff --git a/vendor/google.golang.org/grpc/go.sum b/vendor/google.golang.org/grpc/go.sum index b8638ce76..2a1723474 100644 --- a/vendor/google.golang.org/grpc/go.sum +++ b/vendor/google.golang.org/grpc/go.sum @@ -10,6 +10,8 @@ github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= diff --git a/vendor/google.golang.org/grpc/internal/channelz/funcs.go b/vendor/google.golang.org/grpc/internal/channelz/funcs.go index 041520d35..f0744f993 100644 --- a/vendor/google.golang.org/grpc/internal/channelz/funcs.go +++ b/vendor/google.golang.org/grpc/internal/channelz/funcs.go @@ -24,6 +24,7 @@ package channelz import ( + "fmt" "sort" "sync" "sync/atomic" @@ -95,9 +96,14 @@ func (d *dbWrapper) get() *channelMap { // NewChannelzStorage initializes channelz data storage and id generator. // +// This function returns a cleanup function to wait for all channelz state to be reset by the +// grpc goroutines when those entities get closed. By using this cleanup function, we make sure tests +// don't mess up each other, i.e. lingering goroutine from previous test doing entity removal happen +// to remove some entity just register by the new test, since the id space is the same. +// // Note: This function is exported for testing purpose only. User should not call // it in most cases. -func NewChannelzStorage() { +func NewChannelzStorage() (cleanup func() error) { db.set(&channelMap{ topLevelChannels: make(map[int64]struct{}), channels: make(map[int64]*channel), @@ -107,6 +113,28 @@ func NewChannelzStorage() { subChannels: make(map[int64]*subChannel), }) idGen.reset() + return func() error { + var err error + cm := db.get() + if cm == nil { + return nil + } + for i := 0; i < 1000; i++ { + cm.mu.Lock() + if len(cm.topLevelChannels) == 0 && len(cm.servers) == 0 && len(cm.channels) == 0 && len(cm.subChannels) == 0 && len(cm.listenSockets) == 0 && len(cm.normalSockets) == 0 { + cm.mu.Unlock() + // all things stored in the channelz map have been cleared. + return nil + } + cm.mu.Unlock() + time.Sleep(10 * time.Millisecond) + } + + cm.mu.Lock() + err = fmt.Errorf("after 10s the channelz map has not been cleaned up yet, topchannels: %d, servers: %d, channels: %d, subchannels: %d, listen sockets: %d, normal sockets: %d", len(cm.topLevelChannels), len(cm.servers), len(cm.channels), len(cm.subChannels), len(cm.listenSockets), len(cm.normalSockets)) + cm.mu.Unlock() + return err + } } // GetTopChannels returns a slice of top channel's ChannelMetric, along with a diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 9dee6db61..e26e28141 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -549,7 +549,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea s.write(recvMsg{err: err}) close(s.done) // If headerChan isn't closed, then close it. - if atomic.SwapUint32(&s.headerDone, 1) == 0 { + if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { close(s.headerChan) } @@ -713,7 +713,7 @@ func (t *http2Client) closeStream(s *Stream, err error, rst bool, rstCode http2. s.write(recvMsg{err: err}) } // If headerChan isn't closed, then close it. - if atomic.SwapUint32(&s.headerDone, 1) == 0 { + if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { s.noHeaders = true close(s.headerChan) } @@ -794,21 +794,21 @@ func (t *http2Client) Close() error { // stream is closed. If there are no active streams, the transport is closed // immediately. This does nothing if the transport is already draining or // closing. -func (t *http2Client) GracefulClose() error { +func (t *http2Client) GracefulClose() { t.mu.Lock() // Make sure we move to draining only from active. if t.state == draining || t.state == closing { t.mu.Unlock() - return nil + return } t.state = draining active := len(t.activeStreams) t.mu.Unlock() if active == 0 { - return t.Close() + t.Close() + return } t.controlBuf.put(&incomingGoAway{}) - return nil } // Write formats the data into HTTP2 data frame(s) and sends it out. The caller @@ -1142,26 +1142,24 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { } endStream := frame.StreamEnded() atomic.StoreUint32(&s.bytesReceived, 1) - initialHeader := atomic.SwapUint32(&s.headerDone, 1) == 0 + initialHeader := atomic.LoadUint32(&s.headerChanClosed) == 0 if !initialHeader && !endStream { - // As specified by RFC 7540, a HEADERS frame (and associated CONTINUATION frames) can only appear - // at the start or end of a stream. Therefore, second HEADERS frame must have EOS bit set. + // As specified by gRPC over HTTP2, a HEADERS frame (and associated CONTINUATION frames) can only appear at the start or end of a stream. Therefore, second HEADERS frame must have EOS bit set. st := status.New(codes.Internal, "a HEADERS frame cannot appear in the middle of a stream") t.closeStream(s, st.Err(), true, http2.ErrCodeProtocol, st, nil, false) return } state := &decodeState{} - // Initialize isGRPC value to be !initialHeader, since if a gRPC ResponseHeader has been received - // which indicates peer speaking gRPC, we are in gRPC mode. + // Initialize isGRPC value to be !initialHeader, since if a gRPC Response-Headers has already been received, then it means that the peer is speaking gRPC and we are in gRPC mode. state.data.isGRPC = !initialHeader if err := state.decodeHeader(frame); err != nil { t.closeStream(s, err, true, http2.ErrCodeProtocol, status.Convert(err), nil, endStream) return } - var isHeader bool + isHeader := false defer func() { if t.statsHandler != nil { if isHeader { @@ -1180,10 +1178,10 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { } }() - // If headers haven't been received yet. - if initialHeader { + // If headerChan hasn't been closed yet + if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { if !endStream { - // Headers frame is ResponseHeader. + // HEADERS frame block carries a Response-Headers. isHeader = true // These values can be set without any synchronization because // stream goroutine will read it only after seeing a closed @@ -1192,14 +1190,17 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { if len(state.data.mdata) > 0 { s.header = state.data.mdata } - close(s.headerChan) - return + } else { + // HEADERS frame block carries a Trailers-Only. + s.noHeaders = true } - // Headers frame is Trailers-only. - s.noHeaders = true close(s.headerChan) } + if !endStream { + return + } + // if client received END_STREAM from server while stream was still active, send RST_STREAM rst := s.getState() == streamActive t.closeStream(s, io.EOF, rst, http2.ErrCodeNo, state.status(), state.data.mdata, true) diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 7f82cbb08..4bf583efc 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -204,8 +204,8 @@ type Stream struct { // is used to adjust flow control, if needed. requestRead func(int) - headerChan chan struct{} // closed to indicate the end of header metadata. - headerDone uint32 // set when headerChan is closed. Used to avoid closing headerChan multiple times. + headerChan chan struct{} // closed to indicate the end of header metadata. + headerChanClosed uint32 // set when headerChan is closed. Used to avoid closing headerChan multiple times. // hdrMu protects header and trailer metadata on the server-side. hdrMu sync.Mutex @@ -578,9 +578,12 @@ type ClientTransport interface { // is called only once. Close() error - // GracefulClose starts to tear down the transport. It stops accepting - // new RPCs and wait the completion of the pending RPCs. - GracefulClose() error + // GracefulClose starts to tear down the transport: the transport will stop + // accepting new RPCs and NewStream will return error. Once all streams are + // finished, the transport will close. + // + // It does not block. + GracefulClose() // Write sends the data for the given stream. A nil stream indicates // the write is to be performed on the transport as a whole. diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go index f9625496c..45baa2ae1 100644 --- a/vendor/google.golang.org/grpc/picker_wrapper.go +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -120,6 +120,14 @@ func (bp *pickerWrapper) pick(ctx context.Context, failfast bool, opts balancer. bp.mu.Unlock() select { case <-ctx.Done(): + if connectionErr := bp.connectionError(); connectionErr != nil { + switch ctx.Err() { + case context.DeadlineExceeded: + return nil, nil, status.Errorf(codes.DeadlineExceeded, "latest connection error: %v", connectionErr) + case context.Canceled: + return nil, nil, status.Errorf(codes.Canceled, "latest connection error: %v", connectionErr) + } + } return nil, nil, ctx.Err() case <-ch: } diff --git a/vendor/google.golang.org/grpc/preloader.go b/vendor/google.golang.org/grpc/preloader.go new file mode 100644 index 000000000..76acbbcc9 --- /dev/null +++ b/vendor/google.golang.org/grpc/preloader.go @@ -0,0 +1,64 @@ +/* + * + * Copyright 2019 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 ( + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// PreparedMsg is responsible for creating a Marshalled and Compressed object. +// +// This API is EXPERIMENTAL. +type PreparedMsg struct { + // Struct for preparing msg before sending them + encodedData []byte + hdr []byte + payload []byte +} + +// Encode marshalls and compresses the message using the codec and compressor for the stream. +func (p *PreparedMsg) Encode(s Stream, msg interface{}) error { + ctx := s.Context() + rpcInfo, ok := rpcInfoFromContext(ctx) + if !ok { + return status.Errorf(codes.Internal, "grpc: unable to get rpcInfo") + } + + // check if the context has the relevant information to prepareMsg + if rpcInfo.preloaderInfo == nil { + return status.Errorf(codes.Internal, "grpc: rpcInfo.preloaderInfo is nil") + } + if rpcInfo.preloaderInfo.codec == nil { + return status.Errorf(codes.Internal, "grpc: rpcInfo.preloaderInfo.codec is nil") + } + + // prepare the msg + data, err := encode(rpcInfo.preloaderInfo.codec, msg) + if err != nil { + return err + } + p.encodedData = data + compData, err := compress(data, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp) + if err != nil { + return err + } + p.hdr, p.payload = msgHeader(data, compData) + return nil +} diff --git a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go index 583559907..297492e87 100644 --- a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go +++ b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go @@ -66,6 +66,9 @@ var ( var ( defaultResolver netResolver = net.DefaultResolver + // To prevent excessive re-resolution, we enforce a rate limit on DNS + // resolution requests. + minDNSResRate = 30 * time.Second ) var customAuthorityDialler = func(authority string) func(ctx context.Context, network, address string) (net.Conn, error) { @@ -241,7 +244,13 @@ func (d *dnsResolver) watcher() { return case <-d.t.C: case <-d.rn: + if !d.t.Stop() { + // Before resetting a timer, it should be stopped to prevent racing with + // reads on it's channel. + <-d.t.C + } } + result, sc := d.lookup() // Next lookup should happen within an interval defined by d.freq. It may be // more often due to exponential retry on empty address list. @@ -254,6 +263,16 @@ func (d *dnsResolver) watcher() { } d.cc.NewServiceConfig(sc) d.cc.NewAddress(result) + + // Sleep to prevent excessive re-resolutions. Incoming resolution requests + // will be queued in d.rn. + t := time.NewTimer(minDNSResRate) + select { + case <-t.C: + case <-d.ctx.Done(): + t.Stop() + return + } } } diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index 52ec603da..f6f6934d9 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -132,6 +132,21 @@ type ClientConn interface { // Target represents a target for gRPC, as specified in: // https://github.com/grpc/grpc/blob/master/doc/naming.md. +// It is parsed from the target string that gets passed into Dial or DialContext by the user. And +// grpc passes it to the resolver and the balancer. +// +// If the target follows the naming spec, and the parsed scheme is registered with grpc, we will +// parse the target string according to the spec. e.g. "dns://some_authority/foo.bar" will be parsed +// into &Target{Scheme: "dns", Authority: "some_authority", Endpoint: "foo.bar"} +// +// If the target does not contain a scheme, we will apply the default scheme, and set the Target to +// be the full target string. e.g. "foo.bar" will be parsed into +// &Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "foo.bar"}. +// +// If the parsed scheme is not registered (i.e. no corresponding resolver available to resolve the +// endpoint), we set the Scheme to be the default scheme, and set the Endpoint to be the full target +// string. e.g. target string "unknown_scheme://authority/endpoint" will be parsed into +// &Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "unknown_scheme://authority/endpoint"}. type Target struct { Scheme string Authority string diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index 2a595622d..088c3f1b2 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -694,14 +694,34 @@ func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m interf return nil } +// Information about RPC type rpcInfo struct { - failfast bool + failfast bool + preloaderInfo *compressorInfo +} + +// Information about Preloader +// Responsible for storing codec, and compressors +// If stream (s) has context s.Context which stores rpcInfo that has non nil +// pointers to codec, and compressors, then we can use preparedMsg for Async message prep +// and reuse marshalled bytes +type compressorInfo struct { + codec baseCodec + cp Compressor + comp encoding.Compressor } type rpcInfoContextKey struct{} -func newContextWithRPCInfo(ctx context.Context, failfast bool) context.Context { - return context.WithValue(ctx, rpcInfoContextKey{}, &rpcInfo{failfast: failfast}) +func newContextWithRPCInfo(ctx context.Context, failfast bool, codec baseCodec, cp Compressor, comp encoding.Compressor) context.Context { + return context.WithValue(ctx, rpcInfoContextKey{}, &rpcInfo{ + failfast: failfast, + preloaderInfo: &compressorInfo{ + codec: codec, + cp: cp, + comp: comp, + }, + }) } func rpcInfoFromContext(ctx context.Context) (s *rpcInfo, ok bool) { diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 8115828fd..495a4f9b8 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -86,7 +86,7 @@ type service struct { // Server is a gRPC server to serve RPC requests. type Server struct { - opts options + opts serverOptions mu sync.Mutex // guards following lis map[net.Listener]bool @@ -108,7 +108,7 @@ type Server struct { czData *channelzData } -type options struct { +type serverOptions struct { creds credentials.TransportCredentials codec baseCodec cp Compressor @@ -131,7 +131,7 @@ type options struct { maxHeaderListSize *uint32 } -var defaultServerOptions = options{ +var defaultServerOptions = serverOptions{ maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, maxSendMessageSize: defaultServerMaxSendMessageSize, connectionTimeout: 120 * time.Second, @@ -140,7 +140,33 @@ var defaultServerOptions = options{ } // A ServerOption sets options such as credentials, codec and keepalive parameters, etc. -type ServerOption func(*options) +type ServerOption interface { + apply(*serverOptions) +} + +// EmptyServerOption does not alter the server configuration. It can be embedded +// in another structure to build custom server options. +// +// This API is EXPERIMENTAL. +type EmptyServerOption struct{} + +func (EmptyServerOption) apply(*serverOptions) {} + +// funcServerOption wraps a function that modifies serverOptions into an +// implementation of the ServerOption interface. +type funcServerOption struct { + f func(*serverOptions) +} + +func (fdo *funcServerOption) apply(do *serverOptions) { + fdo.f(do) +} + +func newFuncServerOption(f func(*serverOptions)) *funcServerOption { + return &funcServerOption{ + f: f, + } +} // WriteBufferSize determines how much data can be batched before doing a write on the wire. // The corresponding memory allocation for this buffer will be twice the size to keep syscalls low. @@ -148,9 +174,9 @@ type ServerOption func(*options) // Zero will disable the write buffer such that each write will be on underlying connection. // Note: A Send call may not directly translate to a write. func WriteBufferSize(s int) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.writeBufferSize = s - } + }) } // ReadBufferSize lets you set the size of read buffer, this determines how much data can be read at most @@ -159,25 +185,25 @@ func WriteBufferSize(s int) ServerOption { // Zero will disable read buffer for a connection so data framer can access the underlying // conn directly. func ReadBufferSize(s int) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.readBufferSize = s - } + }) } // InitialWindowSize returns a ServerOption that sets window size for stream. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialWindowSize(s int32) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.initialWindowSize = s - } + }) } // InitialConnWindowSize returns a ServerOption that sets window size for a connection. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialConnWindowSize(s int32) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.initialConnWindowSize = s - } + }) } // KeepaliveParams returns a ServerOption that sets keepalive and max-age parameters for the server. @@ -187,25 +213,25 @@ func KeepaliveParams(kp keepalive.ServerParameters) ServerOption { kp.Time = time.Second } - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.keepaliveParams = kp - } + }) } // KeepaliveEnforcementPolicy returns a ServerOption that sets keepalive enforcement policy for the server. func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.keepalivePolicy = kep - } + }) } // CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling. // // This will override any lookups by content-subtype for Codecs registered with RegisterCodec. func CustomCodec(codec Codec) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.codec = codec - } + }) } // RPCCompressor returns a ServerOption that sets a compressor for outbound @@ -216,9 +242,9 @@ func CustomCodec(codec Codec) ServerOption { // // Deprecated: use encoding.RegisterCompressor instead. func RPCCompressor(cp Compressor) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.cp = cp - } + }) } // RPCDecompressor returns a ServerOption that sets a decompressor for inbound @@ -227,9 +253,9 @@ func RPCCompressor(cp Compressor) ServerOption { // // Deprecated: use encoding.RegisterCompressor instead. func RPCDecompressor(dc Decompressor) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.dc = dc - } + }) } // MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive. @@ -243,73 +269,73 @@ func MaxMsgSize(m int) ServerOption { // MaxRecvMsgSize returns a ServerOption to set the max message size in bytes the server can receive. // If this is not set, gRPC uses the default 4MB. func MaxRecvMsgSize(m int) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.maxReceiveMessageSize = m - } + }) } // MaxSendMsgSize returns a ServerOption to set the max message size in bytes the server can send. // If this is not set, gRPC uses the default `math.MaxInt32`. func MaxSendMsgSize(m int) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.maxSendMessageSize = m - } + }) } // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number // of concurrent streams to each ServerTransport. func MaxConcurrentStreams(n uint32) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.maxConcurrentStreams = n - } + }) } // Creds returns a ServerOption that sets credentials for server connections. func Creds(c credentials.TransportCredentials) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.creds = c - } + }) } // UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the // server. Only one unary interceptor can be installed. The construction of multiple // interceptors (e.g., chaining) can be implemented at the caller. func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { if o.unaryInt != nil { panic("The unary server interceptor was already set and may not be reset.") } o.unaryInt = i - } + }) } // StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the // server. Only one stream interceptor can be installed. func StreamInterceptor(i StreamServerInterceptor) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { if o.streamInt != nil { panic("The stream server interceptor was already set and may not be reset.") } o.streamInt = i - } + }) } // InTapHandle returns a ServerOption that sets the tap handle for all the server // transport to be created. Only one can be installed. func InTapHandle(h tap.ServerInHandle) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { if o.inTapHandle != nil { panic("The tap handle was already set and may not be reset.") } o.inTapHandle = h - } + }) } // StatsHandler returns a ServerOption that sets the stats handler for the server. func StatsHandler(h stats.Handler) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.statsHandler = h - } + }) } // UnknownServiceHandler returns a ServerOption that allows for adding a custom @@ -319,7 +345,7 @@ func StatsHandler(h stats.Handler) ServerOption { // The handling function has full access to the Context of the request and the // stream, and the invocation bypasses interceptors. func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.unknownStreamDesc = &StreamDesc{ StreamName: "unknown_service_handler", Handler: streamHandler, @@ -327,7 +353,7 @@ func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { ClientStreams: true, ServerStreams: true, } - } + }) } // ConnectionTimeout returns a ServerOption that sets the timeout for @@ -337,17 +363,17 @@ func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { // // This API is EXPERIMENTAL. func ConnectionTimeout(d time.Duration) ServerOption { - return func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.connectionTimeout = d - } + }) } // 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 func(o *options) { + return newFuncServerOption(func(o *serverOptions) { o.maxHeaderListSize = &s - } + }) } // NewServer creates a gRPC server which has no service registered and has not @@ -355,7 +381,7 @@ func MaxHeaderListSize(s uint32) ServerOption { func NewServer(opt ...ServerOption) *Server { opts := defaultServerOptions for _, o := range opt { - o(&opts) + o.apply(&opts) } s := &Server{ lis: make(map[net.Listener]bool), diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 6e2bf51e0..e10e62317 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -245,7 +245,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth trInfo.tr.LazyLog(&trInfo.firstLine, false) ctx = trace.NewContext(ctx, trInfo.tr) } - ctx = newContextWithRPCInfo(ctx, c.failFast) + ctx = newContextWithRPCInfo(ctx, c.failFast, c.codec, cp, comp) sh := cc.dopts.copts.StatsHandler var beginTime time.Time if sh != nil { @@ -677,15 +677,13 @@ func (cs *clientStream) SendMsg(m interface{}) (err error) { if !cs.desc.ClientStreams { cs.sentLast = true } - data, err := encode(cs.codec, m) - if err != nil { - return err - } - compData, err := compress(data, cs.cp, cs.comp) + + // load hdr, payload, data + hdr, payload, data, err := prepareMsg(m, cs.codec, cs.cp, cs.comp) if err != nil { return err } - hdr, payload := msgHeader(data, compData) + // TODO(dfawley): should we be checking len(data) instead? 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) @@ -1150,15 +1148,13 @@ func (as *addrConnStream) SendMsg(m interface{}) (err error) { if !as.desc.ClientStreams { as.sentLast = true } - data, err := encode(as.codec, m) - if err != nil { - return err - } - compData, err := compress(data, as.cp, as.comp) + + // load hdr, payload, data + hdr, payld, _, err := prepareMsg(m, as.codec, as.cp, as.comp) if err != nil { return err } - hdr, payld := msgHeader(data, compData) + // TODO(dfawley): should we be checking len(data) instead? 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) @@ -1395,15 +1391,13 @@ func (ss *serverStream) SendMsg(m interface{}) (err error) { ss.t.IncrMsgSent() } }() - data, err := encode(ss.codec, m) - if err != nil { - return err - } - compData, err := compress(data, ss.cp, ss.comp) + + // load hdr, payload, data + hdr, payload, data, err := prepareMsg(m, ss.codec, ss.cp, ss.comp) if err != nil { return err } - hdr, payload := msgHeader(data, compData) + // TODO(dfawley): should we be checking len(data) instead? if len(payload) > ss.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), ss.maxSendMessageSize) @@ -1496,3 +1490,24 @@ func (ss *serverStream) RecvMsg(m interface{}) (err error) { 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 +func prepareMsg(m interface{}, codec baseCodec, cp Compressor, comp encoding.Compressor) (hdr, payload, data []byte, err error) { + if preparedMsg, ok := m.(*PreparedMsg); ok { + 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, err + } + compData, err := compress(data, cp, comp) + if err != nil { + return nil, nil, nil, err + } + hdr, payload = msgHeader(data, compData) + return hdr, payload, data, nil +} diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 092e08825..5c8cb709a 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.20.1" +const Version = "1.21.1" diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh index bd5c8de90..11037b94d 100644 --- a/vendor/google.golang.org/grpc/vet.sh +++ b/vendor/google.golang.org/grpc/vet.sh @@ -75,7 +75,7 @@ git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO # - Do not import math/rand for real library code. Use internal/grpcrand for # thread safety. -git ls-files "*.go" | xargs grep -l '"math/rand"' 2>&1 | (! grep -v '^examples\|^stress\|grpcrand') +git ls-files "*.go" | xargs grep -l '"math/rand"' 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|wrr_test') # - Ensure all ptypes proto packages are renamed when importing. git ls-files "*.go" | (! xargs grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/") @@ -88,7 +88,7 @@ go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go gofmt -s -d -l . 2>&1 | fail_on_output goimports -l . 2>&1 | (! grep -vE "(_mock|\.pb)\.go:") | fail_on_output golint ./... 2>&1 | (! grep -vE "(_mock|\.pb)\.go:") -go tool vet -all . +go vet -all . # - Check that generated proto files are up to date. if [[ -z "${VET_SKIP_PROTO}" ]]; then diff --git a/vendor/gopkg.in/robfig/cron.v2/README.md b/vendor/gopkg.in/robfig/cron.v2/README.md deleted file mode 100644 index a9db98c35..000000000 --- a/vendor/gopkg.in/robfig/cron.v2/README.md +++ /dev/null @@ -1 +0,0 @@ -[![GoDoc](http://godoc.org/github.com/robfig/cron?status.png)](http://godoc.org/github.com/robfig/cron) diff --git a/vendor/gopkg.in/robfig/cron.v2/cron.go b/vendor/gopkg.in/robfig/cron.v2/cron.go deleted file mode 100644 index 9478929b3..000000000 --- a/vendor/gopkg.in/robfig/cron.v2/cron.go +++ /dev/null @@ -1,237 +0,0 @@ -// Package cron implements a cron spec parser and runner. -package cron // import "gopkg.in/robfig/cron.v2" - -import ( - "sort" - "time" -) - -// Cron keeps track of any number of entries, invoking the associated func as -// specified by the schedule. It may be started, stopped, and the entries may -// be inspected while running. -type Cron struct { - entries []*Entry - stop chan struct{} - add chan *Entry - remove chan EntryID - snapshot chan []Entry - running bool - nextID EntryID -} - -// Job is an interface for submitted cron jobs. -type Job interface { - Run() -} - -// Schedule describes a job's duty cycle. -type Schedule interface { - // Next returns the next activation time, later than the given time. - // Next is invoked initially, and then each time the job is run. - Next(time.Time) time.Time -} - -// EntryID identifies an entry within a Cron instance -type EntryID int - -// Entry consists of a schedule and the func to execute on that schedule. -type Entry struct { - // ID is the cron-assigned ID of this entry, which may be used to look up a - // snapshot or remove it. - ID EntryID - - // Schedule on which this job should be run. - Schedule Schedule - - // Next time the job will run, or the zero time if Cron has not been - // started or this entry's schedule is unsatisfiable - Next time.Time - - // Prev is the last time this job was run, or the zero time if never. - Prev time.Time - - // Job is the thing to run when the Schedule is activated. - Job Job -} - -// Valid returns true if this is not the zero entry. -func (e Entry) Valid() bool { return e.ID != 0 } - -// byTime is a wrapper for sorting the entry array by time -// (with zero time at the end). -type byTime []*Entry - -func (s byTime) Len() int { return len(s) } -func (s byTime) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byTime) Less(i, j int) bool { - // Two zero times should return false. - // Otherwise, zero is "greater" than any other time. - // (To sort it at the end of the list.) - if s[i].Next.IsZero() { - return false - } - if s[j].Next.IsZero() { - return true - } - return s[i].Next.Before(s[j].Next) -} - -// New returns a new Cron job runner. -func New() *Cron { - return &Cron{ - entries: nil, - add: make(chan *Entry), - stop: make(chan struct{}), - snapshot: make(chan []Entry), - remove: make(chan EntryID), - running: false, - } -} - -// FuncJob is a wrapper that turns a func() into a cron.Job -type FuncJob func() - -func (f FuncJob) Run() { f() } - -// AddFunc adds a func to the Cron to be run on the given schedule. -func (c *Cron) AddFunc(spec string, cmd func()) (EntryID, error) { - return c.AddJob(spec, FuncJob(cmd)) -} - -// AddJob adds a Job to the Cron to be run on the given schedule. -func (c *Cron) AddJob(spec string, cmd Job) (EntryID, error) { - schedule, err := Parse(spec) - if err != nil { - return 0, err - } - return c.Schedule(schedule, cmd), nil -} - -// Schedule adds a Job to the Cron to be run on the given schedule. -func (c *Cron) Schedule(schedule Schedule, cmd Job) EntryID { - c.nextID++ - entry := &Entry{ - ID: c.nextID, - Schedule: schedule, - Job: cmd, - } - if !c.running { - c.entries = append(c.entries, entry) - } else { - c.add <- entry - } - return entry.ID -} - -// Entries returns a snapshot of the cron entries. -func (c *Cron) Entries() []Entry { - if c.running { - c.snapshot <- nil - return <-c.snapshot - } - return c.entrySnapshot() -} - -// Entry returns a snapshot of the given entry, or nil if it couldn't be found. -func (c *Cron) Entry(id EntryID) Entry { - for _, entry := range c.Entries() { - if id == entry.ID { - return entry - } - } - return Entry{} -} - -// Remove an entry from being run in the future. -func (c *Cron) Remove(id EntryID) { - if c.running { - c.remove <- id - } else { - c.removeEntry(id) - } -} - -// Start the cron scheduler in its own go-routine. -func (c *Cron) Start() { - c.running = true - go c.run() -} - -// run the scheduler.. this is private just due to the need to synchronize -// access to the 'running' state variable. -func (c *Cron) run() { - // Figure out the next activation times for each entry. - now := time.Now().Local() - for _, entry := range c.entries { - entry.Next = entry.Schedule.Next(now) - } - - for { - // Determine the next entry to run. - sort.Sort(byTime(c.entries)) - - var effective time.Time - if len(c.entries) == 0 || c.entries[0].Next.IsZero() { - // If there are no entries yet, just sleep - it still handles new entries - // and stop requests. - effective = now.AddDate(10, 0, 0) - } else { - effective = c.entries[0].Next - } - - select { - case now = <-time.After(effective.Sub(now)): - // Run every entry whose next time was this effective time. - for _, e := range c.entries { - if e.Next != effective { - break - } - go e.Job.Run() - e.Prev = e.Next - e.Next = e.Schedule.Next(effective) - } - continue - - case newEntry := <-c.add: - now = time.Now().Local() - c.entries = append(c.entries, newEntry) - newEntry.Next = newEntry.Schedule.Next(now) - - case <-c.snapshot: - c.snapshot <- c.entrySnapshot() - - case id := <-c.remove: - c.removeEntry(id) - - case <-c.stop: - return - } - - now = time.Now().Local() - } -} - -// Stop the cron scheduler. -func (c *Cron) Stop() { - c.stop <- struct{}{} - c.running = false -} - -// entrySnapshot returns a copy of the current cron entry list. -func (c *Cron) entrySnapshot() []Entry { - var entries = make([]Entry, len(c.entries)) - for i, e := range c.entries { - entries[i] = *e - } - return entries -} - -func (c *Cron) removeEntry(id EntryID) { - var entries []*Entry - for _, e := range c.entries { - if e.ID != id { - entries = append(entries, e) - } - } - c.entries = entries -} diff --git a/vendor/gopkg.in/robfig/cron.v2/parser.go b/vendor/gopkg.in/robfig/cron.v2/parser.go deleted file mode 100644 index a9e6f947a..000000000 --- a/vendor/gopkg.in/robfig/cron.v2/parser.go +++ /dev/null @@ -1,246 +0,0 @@ -package cron - -import ( - "fmt" - "log" - "math" - "strconv" - "strings" - "time" -) - -// Parse returns a new crontab schedule representing the given spec. -// It returns a descriptive error if the spec is not valid. -// -// It accepts -// - Full crontab specs, e.g. "* * * * * ?" -// - Descriptors, e.g. "@midnight", "@every 1h30m" -func Parse(spec string) (_ Schedule, err error) { - // Convert panics into errors - defer func() { - if recovered := recover(); recovered != nil { - err = fmt.Errorf("%v", recovered) - } - }() - - // Extract timezone if present - var loc = time.Local - if strings.HasPrefix(spec, "TZ=") { - i := strings.Index(spec, " ") - if loc, err = time.LoadLocation(spec[3:i]); err != nil { - log.Panicf("Provided bad location %s: %v", spec[3:i], err) - } - spec = strings.TrimSpace(spec[i:]) - } - - // Handle named schedules (descriptors) - if strings.HasPrefix(spec, "@") { - return parseDescriptor(spec, loc), nil - } - - // Split on whitespace. We require 5 or 6 fields. - // (second, optional) (minute) (hour) (day of month) (month) (day of week) - fields := strings.Fields(spec) - if len(fields) != 5 && len(fields) != 6 { - log.Panicf("Expected 5 or 6 fields, found %d: %s", len(fields), spec) - } - - // Add 0 for second field if necessary. - if len(fields) == 5 { - fields = append([]string{"0"}, fields...) - } - - schedule := &SpecSchedule{ - Second: getField(fields[0], seconds), - Minute: getField(fields[1], minutes), - Hour: getField(fields[2], hours), - Dom: getField(fields[3], dom), - Month: getField(fields[4], months), - Dow: getField(fields[5], dow), - Location: loc, - } - - return schedule, nil -} - -// getField returns an Int with the bits set representing all of the times that -// the field represents. A "field" is a comma-separated list of "ranges". -func getField(field string, r bounds) uint64 { - // list = range {"," range} - var bits uint64 - ranges := strings.FieldsFunc(field, func(r rune) bool { return r == ',' }) - for _, expr := range ranges { - bits |= getRange(expr, r) - } - return bits -} - -// getRange returns the bits indicated by the given expression: -// number | number "-" number [ "/" number ] -func getRange(expr string, r bounds) uint64 { - var ( - start, end, step uint - rangeAndStep = strings.Split(expr, "/") - lowAndHigh = strings.Split(rangeAndStep[0], "-") - singleDigit = len(lowAndHigh) == 1 - extraStar uint64 - ) - if lowAndHigh[0] == "*" || lowAndHigh[0] == "?" { - start = r.min - end = r.max - extraStar = starBit - } else { - start = parseIntOrName(lowAndHigh[0], r.names) - switch len(lowAndHigh) { - case 1: - end = start - case 2: - end = parseIntOrName(lowAndHigh[1], r.names) - default: - log.Panicf("Too many hyphens: %s", expr) - } - } - - switch len(rangeAndStep) { - case 1: - step = 1 - case 2: - step = mustParseInt(rangeAndStep[1]) - - // Special handling: "N/step" means "N-max/step". - if singleDigit { - end = r.max - } - default: - log.Panicf("Too many slashes: %s", expr) - } - - if start < r.min { - log.Panicf("Beginning of range (%d) below minimum (%d): %s", start, r.min, expr) - } - if end > r.max { - log.Panicf("End of range (%d) above maximum (%d): %s", end, r.max, expr) - } - if start > end { - log.Panicf("Beginning of range (%d) beyond end of range (%d): %s", start, end, expr) - } - - return getBits(start, end, step) | extraStar -} - -// parseIntOrName returns the (possibly-named) integer contained in expr. -func parseIntOrName(expr string, names map[string]uint) uint { - if names != nil { - if namedInt, ok := names[strings.ToLower(expr)]; ok { - return namedInt - } - } - return mustParseInt(expr) -} - -// mustParseInt parses the given expression as an int or panics. -func mustParseInt(expr string) uint { - num, err := strconv.Atoi(expr) - if err != nil { - log.Panicf("Failed to parse int from %s: %s", expr, err) - } - if num < 0 { - log.Panicf("Negative number (%d) not allowed: %s", num, expr) - } - - return uint(num) -} - -// getBits sets all bits in the range [min, max], modulo the given step size. -func getBits(min, max, step uint) uint64 { - var bits uint64 - - // If step is 1, use shifts. - if step == 1 { - return ^(math.MaxUint64 << (max + 1)) & (math.MaxUint64 << min) - } - - // Else, use a simple loop. - for i := min; i <= max; i += step { - bits |= 1 << i - } - return bits -} - -// all returns all bits within the given bounds. (plus the star bit) -func all(r bounds) uint64 { - return getBits(r.min, r.max, 1) | starBit -} - -// parseDescriptor returns a pre-defined schedule for the expression, or panics -// if none matches. -func parseDescriptor(spec string, loc *time.Location) Schedule { - switch spec { - case "@yearly", "@annually": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: 1 << dom.min, - Month: 1 << months.min, - Dow: all(dow), - Location: loc, - } - - case "@monthly": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: 1 << dom.min, - Month: all(months), - Dow: all(dow), - Location: loc, - } - - case "@weekly": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: all(dom), - Month: all(months), - Dow: 1 << dow.min, - Location: loc, - } - - case "@daily", "@midnight": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: 1 << hours.min, - Dom: all(dom), - Month: all(months), - Dow: all(dow), - Location: loc, - } - - case "@hourly": - return &SpecSchedule{ - Second: 1 << seconds.min, - Minute: 1 << minutes.min, - Hour: all(hours), - Dom: all(dom), - Month: all(months), - Dow: all(dow), - Location: loc, - } - } - - const every = "@every " - if strings.HasPrefix(spec, every) { - duration, err := time.ParseDuration(spec[len(every):]) - if err != nil { - log.Panicf("Failed to parse duration %s: %s", spec, err) - } - return Every(duration) - } - - log.Panicf("Unrecognized descriptor: %s", spec) - return nil -} diff --git a/vendor/kmodules.xyz/client-go/README.md b/vendor/kmodules.xyz/client-go/README.md index db6bf93f4..5c7a8ed4a 100644 --- a/vendor/kmodules.xyz/client-go/README.md +++ b/vendor/kmodules.xyz/client-go/README.md @@ -6,7 +6,7 @@ [![Twitter](https://img.shields.io/twitter/follow/appscodehq.svg?style=social&logo=twitter&label=Follow)](https://twitter.com/intent/follow?screen_name=AppsCodeHQ) # client-go -Kubernetes client-go utilities +Kubernetes client-go utilities. This package is a collection of helper methods for `k8s.io/client-go`. [AppsCode](https://appscode.com) develops and maintains this library and uses across their various projects. `kmodules.xyz/client-go` is not a replacement for `k8s.io/client-go`. ## Related Libraries - [Kubernetes webhook runtime](https://github.com/kmodules/webhook-runtime) diff --git a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go index aed461b67..9f261c849 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go +++ b/vendor/kmodules.xyz/client-go/core/v1/kubernetes.go @@ -7,7 +7,9 @@ import ( "github.com/imdario/mergo" jsoniter "github.com/json-iterator/go" core "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" ) var json = jsoniter.ConfigFastest @@ -266,3 +268,28 @@ func RemoveOwnerReference(meta metav1.Object, owner *core.ObjectReference) { } meta.SetOwnerReferences(ownerRefs) } + +func IsOwnedByRef(o runtime.Object, owner *core.ObjectReference) bool { + obj, err := meta.Accessor(o) + if err != nil { + return false + } + + return o.GetObjectKind().GroupVersionKind() == owner.GroupVersionKind() && + obj.GetName() == owner.Name && + (string(owner.UID) == "" || obj.GetUID() == owner.UID) +} + +func IsOwnedBy(o1 runtime.Object, o2 runtime.Object) bool { + obj, err := meta.Accessor(o1) + if err != nil { + return false + } + owner, err := meta.Accessor(o2) + if err != nil { + return false + } + return o1.GetObjectKind().GroupVersionKind() == o2.GetObjectKind().GroupVersionKind() && + obj.GetName() == owner.GetName() && + (string(owner.GetUID()) == "" || obj.GetUID() == owner.GetUID()) +} diff --git a/vendor/kmodules.xyz/client-go/go.mod b/vendor/kmodules.xyz/client-go/go.mod index 859096683..1a1f2aedd 100644 --- a/vendor/kmodules.xyz/client-go/go.mod +++ b/vendor/kmodules.xyz/client-go/go.mod @@ -3,22 +3,22 @@ module kmodules.xyz/client-go go 1.12 require ( - github.com/Azure/azure-sdk-for-go v21.3.0+incompatible // indirect - github.com/Azure/go-autorest v11.1.0+incompatible // indirect + cloud.google.com/go v0.41.0 // indirect + github.com/Azure/azure-sdk-for-go v31.1.0+incompatible // indirect + github.com/Azure/go-autorest/autorest v0.5.0 // indirect + github.com/Azure/go-autorest/autorest/to v0.2.0 // indirect + github.com/Azure/go-autorest/autorest/validation v0.1.0 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0 - github.com/appscode/go v0.0.0-20190424183524-60025f1135c9 - github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 - github.com/aws/aws-sdk-go v1.14.12 // indirect - github.com/beorn7/perks v1.0.0 // indirect + github.com/appscode/go v0.0.0-20190621064509-6b292c9166e3 + github.com/aws/aws-sdk-go v1.20.20 // indirect github.com/coreos/bbolt v1.3.2 // indirect github.com/coreos/etcd v3.3.13+incompatible // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/davecgh/go-spew v1.1.1 - github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/docker/distribution v0.0.0-20170726174610-edc3ab29cdff github.com/docker/docker v0.0.0-20180612054059-a9fbbdc8dd87 github.com/docker/go-connections v0.3.0 // indirect @@ -28,15 +28,13 @@ require ( github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f // indirect github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect github.com/emicklei/go-restful v2.9.3+incompatible // indirect - github.com/evanphx/json-patch v4.2.0+incompatible + github.com/evanphx/json-patch v4.5.0+incompatible github.com/fatih/structs v1.1.0 github.com/fsnotify/fsnotify v1.4.7 - github.com/go-ini/ini v1.40.0 // indirect github.com/go-openapi/spec v0.19.0 github.com/gogo/protobuf v1.2.1 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect - github.com/google/btree v1.0.0 // indirect github.com/google/go-cmp v0.3.0 github.com/google/gofuzz v1.0.0 // indirect github.com/googleapis/gnostic v0.2.0 // indirect @@ -48,9 +46,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.8.6 // indirect - github.com/hashicorp/golang-lru v0.5.1 // indirect github.com/imdario/mergo v0.3.5 - github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect github.com/jonboulle/clockwork v0.1.0 // indirect github.com/jpillora/go-ogle-analytics v0.0.0-20161213085824-14b04e0594ef github.com/json-iterator/go v1.1.6 @@ -65,9 +61,7 @@ require ( github.com/pborman/uuid v1.2.0 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.8.1 - github.com/prometheus/client_golang v0.9.2 // indirect - github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect - github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 // indirect + github.com/prometheus/client_golang v0.9.4 // indirect github.com/rancher/go-rancher v0.0.0-20160922212217-09693a8743ba // indirect github.com/sergi/go-diff v1.0.0 // indirect github.com/sirupsen/logrus v1.4.1 // indirect @@ -85,22 +79,17 @@ require ( go.uber.org/atomic v1.4.0 // indirect go.uber.org/multierr v1.1.0 // indirect go.uber.org/zap v1.10.0 // indirect - golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect - golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b // indirect - golang.org/x/text v0.3.2 // indirect - golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect + gomodules.xyz/jsonpatch/v2 v2.0.0 gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3 - google.golang.org/appengine v1.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.40.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3 // indirect gopkg.in/square/go-jose.v2 v2.2.1 // indirect gotest.tools v2.2.0+incompatible // indirect k8s.io/api v0.0.0-20190313235455-40a48860b5ab - k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed + k8s.io/apiextensions-apiserver v0.0.0-20190516231611-bf6753f2aa24 k8s.io/apimachinery v0.0.0-20190424052434-11f1676e3da4 - k8s.io/apiserver v0.0.0-00010101000000-000000000000 - k8s.io/cli-runtime v0.0.0-20190314001948-2899ed30580f + k8s.io/apiserver v0.0.0-20190516230822-f89599b3f645 + k8s.io/cli-runtime v0.0.0-20190516231937-17bc0b7fcef5 k8s.io/client-go v11.0.0+incompatible k8s.io/cloud-provider v0.0.0-20190314002645-c892ea32361a // indirect k8s.io/component-base v0.0.0-20190424053038-9fe063da3132 // indirect @@ -114,7 +103,7 @@ require ( ) replace ( - github.com/graymeta/stow => github.com/appscode/stow v0.0.0-20190506085026-ca5baa008ea3 + github.com/Azure/go-autorest => github.com/Azure/go-autorest/autorest v0.5.0 k8s.io/api => k8s.io/api v0.0.0-20190313235455-40a48860b5ab k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed k8s.io/apimachinery => github.com/kmodules/apimachinery v0.0.0-20190508045248-a52a97a7a2bf diff --git a/vendor/kmodules.xyz/client-go/go.sum b/vendor/kmodules.xyz/client-go/go.sum index 7947bba75..88837d540 100644 --- a/vendor/kmodules.xyz/client-go/go.sum +++ b/vendor/kmodules.xyz/client-go/go.sum @@ -1,12 +1,46 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/Azure/azure-sdk-for-go v21.3.0+incompatible h1:YFvAka2WKAl2xnJkYV1e1b7E2z88AgFszDzWU18ejMY= +cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= +cloud.google.com/go v0.41.0 h1:NFvqUTDnSNYPX5oReekmB+D+90jrJIcVImxQ3qrBVgM= +cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= +contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= +contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc= +contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= +contrib.go.opencensus.io/exporter/stackdriver v0.11.0/go.mod h1:hA7rlmtavV03FGxzWXAPBUnZeZBhWN/QYQAuMtxc9Bk= +contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= +contrib.go.opencensus.io/resource v0.0.0-20190131005048-21591786a5e0/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= +github.com/Azure/azure-amqp-common-go v1.1.3/go.mod h1:FhZtXirFANw40UXI2ntweO+VOkfaw8s6vZxUiRhLYW8= +github.com/Azure/azure-amqp-common-go v1.1.4/go.mod h1:FhZtXirFANw40UXI2ntweO+VOkfaw8s6vZxUiRhLYW8= +github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= +github.com/Azure/azure-pipeline-go v0.1.9/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= github.com/Azure/azure-sdk-for-go v21.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest v11.1.0+incompatible h1:9DfMsQdUMEtg1jKRTjtkNZsvOuZXJOMl4dN1kiQwAc8= -github.com/Azure/go-autorest v11.1.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/azure-sdk-for-go v27.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v31.1.0+incompatible h1:5SzgnfAvUBdBwNTN23WLfZoCt/rGhLvd7QdCAaFXgY4= +github.com/Azure/azure-sdk-for-go v31.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-service-bus-go v0.4.1/go.mod h1:d9ho9e/06euiTwGpKxmlbpPhFUsfCsq6a4tZ68r51qI= +github.com/Azure/azure-storage-blob-go v0.6.0/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= +github.com/Azure/go-autorest/autorest v0.5.0 h1:Mlm9qy2fpQ9MvfyI41G2Zf5B4CsgjjNbLOWszfK6KrY= +github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw= +github.com/Azure/go-autorest/autorest/adal v0.2.0 h1:7IBDu1jgh+ADHXnEYExkV9RE/ztOOlxdACkkPRthGKw= +github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= +github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/mocks v0.1.0 h1:Kx+AUU2Te+A3JIyYn6Dfs+cFgx5XorQKuIXrZGoq/SI= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/to v0.2.0 h1:nQOZzFCudTh+TvquAtCRjM01VEYx85e9qbwt5ncW4L8= +github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= +github.com/Azure/go-autorest/autorest/validation v0.1.0 h1:ISSNzGUh+ZSzizJWOWzs8bwpXIePbGLW4z/AmUFGH5A= +github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= +github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.1.0 h1:TRBxC5Pj/fIuh4Qob0ZpkggbfT8RC0SubHbpV3p4/Vc= +github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190418212003-6ac0b49e7197/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -14,20 +48,30 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0 h1:AQhNemZFEetjnmg8cmNd0Cgcun6/aJTwjY/9UM6ZBhw= github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0/go.mod h1:W9bsWfSbgJXUXzBZ+tSBV2g+zzT7ANPHQFsSXRHYKsA= -github.com/appscode/go v0.0.0-20190424183524-60025f1135c9 h1:uIXQ61ZjsDmN6WhdBJNpd8vMCPBORLNd75MDNU8nUO4= -github.com/appscode/go v0.0.0-20190424183524-60025f1135c9/go.mod h1:/PrESzUKHRrwhmBMpVXfGK3e/D0tqN+/dc8nSH03llU= -github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSepE2OqVu0Pn1CbDw9IuMlONapol0zuwk= -github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= -github.com/aws/aws-sdk-go v1.14.12 h1:VvSayx3QBBH9qoEO2ygDfpqNDTqq5UtqyL2wRWJxCTk= -github.com/aws/aws-sdk-go v1.14.12/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= +github.com/appscode/go v0.0.0-20190621064509-6b292c9166e3 h1:3V9/ZIWMUreWG6JTP34N2mii+gt2XCek7xPS66qKm90= +github.com/appscode/go v0.0.0-20190621064509-6b292c9166e3/go.mod h1:lZoPivA2BU6pxBzZ4KssqO69zfmCV5J4bscOFLIbCEA= +github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= +github.com/aws/aws-sdk-go v1.18.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.19.16/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.20.20 h1:OAR/GtjMOhenkp1NNKr1N1FgIP3mQXHeGbRhvVIAQp0= +github.com/aws/aws-sdk-go v1.20.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4= +github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE= github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= @@ -43,8 +87,10 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denisenkom/go-mssqldb v0.0.0-20190121005146-b04fd42d9952/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/docker/distribution v0.0.0-20170726174610-edc3ab29cdff h1:FKH02LHYqSmeWd3GBh0KIkM8JBpw3RrShgtcWShdWJg= github.com/docker/distribution v0.0.0-20170726174610-edc3ab29cdff/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.0.0-20180612054059-a9fbbdc8dd87 h1:a9PI9K38c+lqsMzO5itpsaXd9BhUYWTC9GM7TN5Vn0U= @@ -57,27 +103,30 @@ github.com/docker/libtrust v0.0.0-20150526203908-9cbd2a1374f4 h1:k8TfKGeAcDQFFQO github.com/docker/libtrust v0.0.0-20150526203908-9cbd2a1374f4/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c h1:ZfSZ3P3BedhKGUhzj7BQlPSU4OvT6tfOKe3DVHzOA7s= github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f h1:8GDPb0tCY8LQ+OJ3dbHb5sA6YZWXFORQYZx5sdsTlMs= github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f h1:AUj1VoZUfhPhOPHULCQQDnGhRelpFWHMLhQVWDsS0v4= github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful v2.9.3+incompatible h1:2OwhVdhtzYUp5P5wuGsVDPagKSRd9JK72sJCHVCXh5g= github.com/emicklei/go-restful v2.9.3+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flosch/pongo2 v0.0.0-20181225140029-79872a7b2769/go.mod h1:tbAXHifHQWNSpWbiJHpJTZH5fi3XHhDMdP//vuz9WS4= +github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-check/check v1.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-ini/ini v1.40.0 h1:/pbZah2UXAjMCtUlVRASCb6nX+0A8aCXjmYouBEXu0c= -github.com/go-ini/ini v1.40.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ0dwoRHP0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonreference v0.17.0 h1:yJW3HCkTHg7NOA+gZ83IPHzUSnUzGXhGmsdiCcMexbA= @@ -86,6 +135,14 @@ github.com/go-openapi/spec v0.19.0 h1:A4SZ6IWh3lnjH0rG0Z5lkxazMGBECtrZcbyYQi+64k github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/swag v0.17.0 h1:iqrgMg7Q7SvtbWLlltPrkMs0UBJI6oTSs79JFRUi880= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-xorm/builder v0.3.3/go.mod h1:v8mE3MFBgtL+RGFNfUnAMUqqfk/Y4W5KuwCFQIEpQLk= +github.com/go-xorm/core v0.6.2/go.mod h1:bwPIfLdm/FzWgVUH8WPVlr+uJhscvNGFcaZKXsI3n2c= +github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM= +github.com/go-xorm/xorm v0.7.3/go.mod h1:npNkX0GgFcODSSKHj7nhJPobHwa5E7usBBZUFaxCsXA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= @@ -93,19 +150,33 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/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 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/wire v0.2.2/go.mod h1:7FHVg6mFpFQrjeUZrm+BaD50N5jnDKm50uVPTpyYOmU= +github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/gophercloud/gophercloud v0.0.0-20190504011306-6f9faf57fddc h1:uSlJNJjuqu+HrNGtCqIVjtMjrC0lzUjXZqfiUHxSzZc= @@ -113,6 +184,8 @@ github.com/gophercloud/gophercloud v0.0.0-20190504011306-6f9faf57fddc/go.mod h1: github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU= github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= @@ -125,11 +198,12 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmo github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.8.6 h1:XvND7+MPP7Jp+JpqSZ7naSl5nVZf6k0LbL1V3EKh0zc= github.com/grpc-ecosystem/grpc-gateway v1.8.6/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c h1:kQWxfPIHVLbgLzphqk3QUflDy9QdksZR4ygR807bpy0= github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -137,19 +211,25 @@ github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= +github.com/jackc/pgx v3.3.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/go-ogle-analytics v0.0.0-20161213085824-14b04e0594ef h1:jLpa0vamfyIGeIJ/CfUJEWoKriw4ODeOgF1XxDvgMZ4= github.com/jpillora/go-ogle-analytics v0.0.0-20161213085824-14b04e0594ef/go.mod h1:PlwhC7q1VSK73InDzdDatVetQrTsQHIbOvcJAZzitY0= github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -161,11 +241,14 @@ github.com/kmodules/apiserver v0.0.0-20190508082252-8397d761d4b5/go.mod h1:rMEIm 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 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= @@ -173,9 +256,11 @@ github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcncea github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -186,39 +271,55 @@ github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30 h1:10VrZWOtDSvWhgViCi2J6VUp4p/B3pOA/efiMH3KjjI= github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.4 h1:Y8E/JaaPbmFSW2V81Ab/d8yZFYQQGbni1b1jPcG9Y6A= +github.com/prometheus/client_golang v0.9.4/go.mod h1:oCXIBxdI62A4cR6aTRJCgetEjecSIYzOEaeAn4iYEpM= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 h1:PnBWHBf+6L0jOqq0gIVUe6Yk0/QMZ640k6NvkxcBf+8= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/rancher/go-rancher v0.0.0-20160922212217-09693a8743ba h1:YPSbZK9YwHzifTgnX/TdxhL+UV9FCk+9ku9Iz1uc8kc= github.com/rancher/go-rancher v0.0.0-20160922212217-09693a8743ba/go.mod h1:7oQvGNiJsGvrUgB+7AH8bmdzuR0uhULfwKb43Ht0hUk= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= @@ -239,8 +340,14 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= +github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v1.5.0/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yudai/gojsondiff v0.0.0-20180504020246-0525c875b75c h1:/8Xb/f8s2/ZZpzMzBkFwW2Jvj7Pglk+AW8m8FFqOoIQ= @@ -249,74 +356,154 @@ github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3Ifn github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= +github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.mongodb.org/mongo-driver v1.0.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +gocloud.dev v0.15.0/go.mod h1:ShXCyJaGrJu9y/7a6+DSCyBb9MFGZ1P5wwPa0Wu6w34= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190122013713-64072686203f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd h1:sMHc2rZHuzQmrbVoSpt9HgerkXPyIeCSO6k0zUMGfFk= golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 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= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190322120337-addf6b3196f6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.0.0 h1:OyHbl+7IOECpPKfVK42oFr6N7+Y2dR+Jsb/IiDV3hOo= +gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3 h1:MiBtMikyjuBwD22+QIEsbnMHdRkknM/0N5ig34jSNgQ= gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0 h1:9sdfJOzWlkqPltHAuzT2Cp+yrBeY1KRVYgms8soxMwM= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 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 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190626174449-989357319d63 h1:UsSJe9fhWNSz6emfIGPpH5DF23t7ALo2Pf3sC+/hsdg= +google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +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-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.40.0 h1:JOoHKRa3vZxx47SL6sOY0gj0hfmA24l+BkQ4CftFizc= -gopkg.in/ini.v1 v1.40.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3 h1:AFxeG48hTWHhDTQDk/m2gorfVHUEa9vo3tp3D7TzwjI= gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= @@ -326,13 +513,15 @@ gopkg.in/square/go-jose.v2 v2.2.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc= k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed h1:rCteec//ELIjZMfjIGQbVtZooyaofqDJwsmWwWKItNs= @@ -355,6 +544,9 @@ k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4= k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= +pack.ag/amqp v0.8.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= +pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2 h1:9r5DY45ef9LtcA6BnkhW8MPV7OKAfbf2AUwUhq3LeRk= diff --git a/vendor/kmodules.xyz/client-go/meta/patch.go b/vendor/kmodules.xyz/client-go/meta/patch.go index 3557480c4..34ca2380c 100644 --- a/vendor/kmodules.xyz/client-go/meta/patch.go +++ b/vendor/kmodules.xyz/client-go/meta/patch.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - jp "github.com/appscode/jsonpatch" jsonpatch "github.com/evanphx/json-patch" jsoniter "github.com/json-iterator/go" + jp "gomodules.xyz/jsonpatch/v2" "k8s.io/apimachinery/pkg/util/mergepatch" "k8s.io/apimachinery/pkg/util/strategicpatch" ) diff --git a/vendor/kmodules.xyz/offshoot-api/util/runtime_settings.go b/vendor/kmodules.xyz/offshoot-api/util/runtime_settings.go new file mode 100644 index 000000000..ad2d0ff14 --- /dev/null +++ b/vendor/kmodules.xyz/offshoot-api/util/runtime_settings.go @@ -0,0 +1,110 @@ +package util + +import ( + "fmt" + + core "k8s.io/api/core/v1" + core_util "kmodules.xyz/client-go/core/v1" + ofst "kmodules.xyz/offshoot-api/api/v1" +) + +const ( + NiceAdjustment = "NICE_ADJUSTMENT" + IONiceClass = "IONICE_CLASS" + IONiceClassData = "IONICE_CLASS_DATA" +) + +func ApplyContainerRuntimeSettings(container core.Container, settings ofst.ContainerRuntimeSettings) core.Container { + if len(settings.Resources.Limits) > 0 { + container.Resources.Limits = settings.Resources.Limits + } + if len(settings.Resources.Limits) > 0 { + container.Resources.Requests = settings.Resources.Requests + } + if settings.LivenessProbe != nil { + container.LivenessProbe = settings.LivenessProbe + } + if settings.ReadinessProbe != nil { + container.ReadinessProbe = settings.ReadinessProbe + } + if settings.Lifecycle != nil { + container.Lifecycle = settings.Lifecycle + } + if settings.SecurityContext != nil { + container.SecurityContext = settings.SecurityContext + } + if len(settings.EnvFrom) > 0 { + container.EnvFrom = append(container.EnvFrom, settings.EnvFrom...) + } + if len(settings.Env) > 0 { + container.Env = core_util.UpsertEnvVars(container.Env, settings.Env...) + } + // set nice, ionice settings as env + if settings.Nice != nil && settings.Nice.Adjustment != nil { + container.Env = core_util.UpsertEnvVars(container.Env, core.EnvVar{ + Name: NiceAdjustment, + Value: fmt.Sprint(*settings.Nice.Adjustment), + }) + } + if settings.IONice != nil { + if settings.IONice.Class != nil { + container.Env = core_util.UpsertEnvVars(container.Env, core.EnvVar{ + Name: IONiceClass, + Value: fmt.Sprint(*settings.IONice.Class), + }) + } + if settings.IONice.ClassData != nil { + container.Env = core_util.UpsertEnvVars(container.Env, core.EnvVar{ + Name: IONiceClassData, + Value: fmt.Sprint(*settings.IONice.ClassData), + }) + } + } + return container +} + +func ApplyPodRuntimeSettings(podSpec core.PodSpec, settings ofst.PodRuntimeSettings) core.PodSpec { + if settings.NodeSelector != nil && len(settings.NodeSelector) > 0 { + podSpec.NodeSelector = settings.NodeSelector + } + if settings.ServiceAccountName != "" { + podSpec.ServiceAccountName = settings.ServiceAccountName + } + if settings.AutomountServiceAccountToken != nil { + podSpec.AutomountServiceAccountToken = settings.AutomountServiceAccountToken + } + if settings.NodeName != "" { + podSpec.NodeName = settings.NodeName + } + if settings.SecurityContext != nil { + podSpec.SecurityContext = settings.SecurityContext + } + if len(settings.ImagePullSecrets) > 0 { + podSpec.ImagePullSecrets = settings.ImagePullSecrets + } + if settings.Affinity != nil { + podSpec.Affinity = settings.Affinity + } + if settings.SchedulerName != "" { + podSpec.SchedulerName = settings.SchedulerName + } + if len(settings.Tolerations) > 0 { + podSpec.Tolerations = settings.Tolerations + } + if settings.PriorityClassName != "" { + podSpec.PriorityClassName = settings.PriorityClassName + } + if settings.Priority != nil { + podSpec.Priority = settings.Priority + } + if len(settings.ReadinessGates) > 0 { + podSpec.ReadinessGates = settings.ReadinessGates + } + if settings.RuntimeClassName != nil { + podSpec.RuntimeClassName = settings.RuntimeClassName + } + if settings.EnableServiceLinks != nil { + podSpec.EnableServiceLinks = settings.EnableServiceLinks + } + return podSpec +} diff --git a/vendor/modules.txt b/vendor/modules.txt index bbc3c0ed8..63552d980 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,19 +1,23 @@ -# cloud.google.com/go v0.39.0 +# cloud.google.com/go v0.41.0 cloud.google.com/go/compute/metadata -# contrib.go.opencensus.io/exporter/ocagent v0.5.0 +# contrib.go.opencensus.io/exporter/ocagent v0.4.12 contrib.go.opencensus.io/exporter/ocagent -# github.com/Azure/go-autorest v12.0.0+incompatible +# github.com/Azure/go-autorest/autorest v0.5.0 github.com/Azure/go-autorest/autorest -github.com/Azure/go-autorest/autorest/adal github.com/Azure/go-autorest/autorest/azure +# github.com/Azure/go-autorest/autorest/adal v0.2.0 +github.com/Azure/go-autorest/autorest/adal +# github.com/Azure/go-autorest/autorest/date v0.1.0 +github.com/Azure/go-autorest/autorest/date +# github.com/Azure/go-autorest/logger v0.1.0 github.com/Azure/go-autorest/logger +# github.com/Azure/go-autorest/tracing v0.1.0 github.com/Azure/go-autorest/tracing -github.com/Azure/go-autorest/autorest/date # github.com/PuerkitoBio/purell v1.1.1 github.com/PuerkitoBio/purell # github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 github.com/PuerkitoBio/urlesc -# github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8 +# github.com/appscode/go v0.0.0-20190621064509-6b292c9166e3 github.com/appscode/go/log github.com/appscode/go/version github.com/appscode/go/flags @@ -26,8 +30,6 @@ github.com/appscode/go/encoding/json/types github.com/appscode/go/analytics github.com/appscode/go/net github.com/appscode/go/homedir -# github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 -github.com/appscode/jsonpatch # github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 github.com/armon/circbuf # github.com/beorn7/perks v1.0.0 @@ -50,7 +52,7 @@ github.com/dgrijalva/jwt-go # github.com/emicklei/go-restful v2.9.5+incompatible github.com/emicklei/go-restful github.com/emicklei/go-restful/log -# github.com/evanphx/json-patch v4.2.0+incompatible +# github.com/evanphx/json-patch v4.5.0+incompatible github.com/evanphx/json-patch # github.com/fatih/structs v1.1.0 github.com/fatih/structs @@ -145,7 +147,7 @@ github.com/modern-go/reflect2 github.com/peterbourgon/diskv # github.com/pkg/errors v0.8.1 github.com/pkg/errors -# github.com/prometheus/client_golang v0.9.3 +# github.com/prometheus/client_golang v0.9.4 github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/push github.com/prometheus/client_golang/prometheus/internal @@ -155,12 +157,14 @@ github.com/prometheus/client_model/go github.com/prometheus/common/expfmt github.com/prometheus/common/model github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg -# github.com/prometheus/procfs v0.0.0-20190523193104-a7aeb8df3389 +# github.com/prometheus/procfs v0.0.2 github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs +# github.com/robfig/cron/v3 v3.0.0 +github.com/robfig/cron/v3 # github.com/sergi/go-diff v1.0.0 github.com/sergi/go-diff/diffmatchpatch -# github.com/spf13/cobra v0.0.4 +# github.com/spf13/cobra v0.0.5 github.com/spf13/cobra # github.com/spf13/pflag v1.0.3 github.com/spf13/pflag @@ -169,7 +173,7 @@ github.com/yudai/gojsondiff github.com/yudai/gojsondiff/formatter # github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 github.com/yudai/golcs -# go.opencensus.io v0.21.0 +# go.opencensus.io v0.22.0 go.opencensus.io/plugin/ochttp go.opencensus.io/plugin/ochttp/propagation/tracecontext go.opencensus.io/stats/view @@ -188,9 +192,9 @@ go.opencensus.io/metric/metricproducer go.opencensus.io/stats/internal go.opencensus.io/internal go.opencensus.io/trace/internal -# golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f +# golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 golang.org/x/crypto/ssh/terminal -# golang.org/x/net v0.0.0-20190522155817-f3200d17e092 +# golang.org/x/net v0.0.0-20190620200207-3b0461eec859 golang.org/x/net/http2 golang.org/x/net/http/httpguts golang.org/x/net/http2/hpack @@ -199,7 +203,7 @@ golang.org/x/net/context/ctxhttp golang.org/x/net/context golang.org/x/net/trace golang.org/x/net/internal/timeseries -# golang.org/x/oauth2 v0.0.0-20190523182746-aaccbc9213b0 +# golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 golang.org/x/oauth2 golang.org/x/oauth2/google golang.org/x/oauth2/internal @@ -207,7 +211,7 @@ golang.org/x/oauth2/jws golang.org/x/oauth2/jwt # golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sync/semaphore -# golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5 +# golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.3.2 @@ -224,9 +228,11 @@ golang.org/x/text/internal/utf8internal golang.org/x/text/runes # golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 golang.org/x/time/rate -# google.golang.org/api v0.5.0 +# gomodules.xyz/jsonpatch/v2 v2.0.0 +gomodules.xyz/jsonpatch/v2 +# google.golang.org/api v0.7.0 google.golang.org/api/support/bundler -# google.golang.org/appengine v1.6.0 +# google.golang.org/appengine v1.6.1 google.golang.org/appengine google.golang.org/appengine/urlfetch google.golang.org/appengine/internal @@ -237,11 +243,11 @@ google.golang.org/appengine/internal/base google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log google.golang.org/appengine/internal/remote_api -# google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8 +# google.golang.org/genproto v0.0.0-20190626174449-989357319d63 google.golang.org/genproto/googleapis/api/httpbody google.golang.org/genproto/protobuf/field_mask google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.20.1 +# google.golang.org/grpc v1.21.1 google.golang.org/grpc google.golang.org/grpc/credentials google.golang.org/grpc/metadata @@ -276,8 +282,6 @@ google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/internal/syscall # gopkg.in/inf.v0 v0.9.1 gopkg.in/inf.v0 -# gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5 => github.com/appscode/cron v0.0.0-20170717094345-ca60c6d796d4 -gopkg.in/robfig/cron.v2 # gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 # k8s.io/api v0.0.0-20190515023547-db5a9d1c40eb => k8s.io/api v0.0.0-20190313235455-40a48860b5ab @@ -317,7 +321,7 @@ k8s.io/api/settings/v1alpha1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apiextensions-apiserver v0.0.0-20190515024537-2fd0e9006049 => k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed +# k8s.io/apiextensions-apiserver v0.0.0-20190516231611-bf6753f2aa24 => k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme @@ -369,7 +373,7 @@ k8s.io/apimachinery/pkg/apis/meta/internalversion k8s.io/apimachinery/pkg/api/validation k8s.io/apimachinery/pkg/apis/meta/v1/validation k8s.io/apimachinery/pkg/api/equality -# k8s.io/cli-runtime v0.0.0-20190515024640-178667528169 => k8s.io/cli-runtime v0.0.0-20190314001948-2899ed30580f +# k8s.io/cli-runtime v0.0.0-20190516231937-17bc0b7fcef5 => k8s.io/cli-runtime v0.0.0-20190314001948-2899ed30580f k8s.io/cli-runtime/pkg/genericclioptions k8s.io/cli-runtime/pkg/printers k8s.io/cli-runtime/pkg/resource @@ -504,7 +508,7 @@ k8s.io/kubernetes/pkg/util/hash k8s.io/utils/integer k8s.io/utils/buffer k8s.io/utils/trace -# kmodules.xyz/client-go v0.0.0-20190518160232-4afdbc13ba68 +# kmodules.xyz/client-go v0.0.0-20190715080709-7162a6c90b04 kmodules.xyz/client-go/logs kmodules.xyz/client-go/tools/cli kmodules.xyz/client-go/tools/analytics @@ -519,10 +523,11 @@ kmodules.xyz/custom-resources/client/clientset/versioned/typed/appcatalog/v1alph kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1 kmodules.xyz/custom-resources/client/clientset/versioned/scheme kmodules.xyz/custom-resources/apis/appcatalog -# kmodules.xyz/objectstore-api v0.0.0-20190516233206-ea3ba546e348 +# kmodules.xyz/objectstore-api v0.0.0-20190718002052-da668b440b0b kmodules.xyz/objectstore-api/api/v1 -# kmodules.xyz/offshoot-api v0.0.0-20190513045534-4f3df05f40c2 +# kmodules.xyz/offshoot-api v0.0.0-20190715115723-36c8fce142c1 kmodules.xyz/offshoot-api/api/v1 +kmodules.xyz/offshoot-api/util # kmodules.xyz/openshift v0.0.0-20190508141315-99ec9fc946bf kmodules.xyz/openshift/client/clientset/versioned kmodules.xyz/openshift/client/clientset/versioned/typed/apps/v1 @@ -530,7 +535,7 @@ kmodules.xyz/openshift/client/clientset/versioned/typed/security/v1 kmodules.xyz/openshift/apis/apps/v1 kmodules.xyz/openshift/client/clientset/versioned/scheme kmodules.xyz/openshift/apis/security/v1 -# kmodules.xyz/webhook-runtime v0.0.0-20190508094945-962d01212c5b +# kmodules.xyz/webhook-runtime v0.0.0-20190715115250-a84fbf77dd30 kmodules.xyz/webhook-runtime/apis/workload/v1 # sigs.k8s.io/kustomize v2.0.3+incompatible sigs.k8s.io/kustomize/pkg/fs @@ -557,7 +562,7 @@ sigs.k8s.io/kustomize/pkg/expansion sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig # sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml -# stash.appscode.dev/stash v0.0.0-20190523192034-eadca45d8c6b +# stash.appscode.dev/stash v0.0.0-20190718155146-3de534baa0a0 stash.appscode.dev/stash/client/clientset/versioned/fake stash.appscode.dev/stash/apis stash.appscode.dev/stash/client/clientset/versioned/scheme @@ -573,6 +578,7 @@ stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1 stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1 stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake +stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util stash.appscode.dev/stash/client/listers/stash/v1alpha1 stash.appscode.dev/stash/client/listers/stash/v1beta1 stash.appscode.dev/stash/pkg/docker diff --git a/vendor/stash.appscode.dev/stash/apis/constants.go b/vendor/stash.appscode.dev/stash/apis/constants.go index e1cd8b678..24de5ea0f 100644 --- a/vendor/stash.appscode.dev/stash/apis/constants.go +++ b/vendor/stash.appscode.dev/stash/apis/constants.go @@ -18,6 +18,7 @@ const ( TargetName = "TARGET_NAME" TargetAPIVersion = "TARGET_API_VERSION" TargetKind = "TARGET_KIND" + TargetResource = "TARGET_RESOURCE" TargetNamespace = "TARGET_NAMESPACE" TargetMountPath = "TARGET_MOUNT_PATH" TargetDirectories = "TARGET_DIRECTORIES" @@ -46,4 +47,6 @@ const ( IONiceClassData = "IONICE_CLASS_DATA" StatusSubresourceEnabled = "ENABLE_STATUS_SUBRESOURCE" + + PushgatewayURL = "PROMETHEUS_PUSHGATEWAY_URL" ) diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/validator.go b/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/validator.go index beeb43b77..207d7453a 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/validator.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/validator.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - cron "gopkg.in/robfig/cron.v2" + cron "github.com/robfig/cron/v3" ) func (r Restic) IsValid() error { @@ -25,7 +25,7 @@ func (r Restic) IsValid() error { } } - _, err := cron.Parse(r.Spec.Schedule) + _, err := cron.ParseStandard(r.Spec.Schedule) if err != nil { return fmt.Errorf("spec.schedule %s is invalid. Reason: %s", r.Spec.Schedule, err) } diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/annotations.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/annotations.go index 7ad3e1c4f..50fdeae45 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/annotations.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/annotations.go @@ -1,10 +1,8 @@ package v1beta1 const ( - VersionTag = BackupKey + "/tag" // ResourceVersion will be used to trigger restarts for ReplicaSet and RC pods - StashKey = "stash.appscode.com" - BackupKey = "backup.appscode.com" + StashKey = "stash.appscode.com" KeyBackupConfigurationTemplate = StashKey + "/backup-template" KeyTargetDirectories = StashKey + "/target-directories" diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_helpers.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_helpers.go index 02622b1f7..28214ac56 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_helpers.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_helpers.go @@ -7,6 +7,7 @@ import ( apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" hashutil "k8s.io/kubernetes/pkg/util/hash" crdutils "kmodules.xyz/client-go/apiextensions/v1beta1" + meta_util "kmodules.xyz/client-go/meta" ) func (b BackupConfiguration) GetSpecHash() string { @@ -15,7 +16,7 @@ func (b BackupConfiguration) GetSpecHash() string { return strconv.FormatUint(hash.Sum64(), 10) } -func (bc BackupConfiguration) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (b BackupConfiguration) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crdutils.NewCustomResourceDefinition(crdutils.Config{ Group: SchemeGroupVersion.Group, Plural: ResourcePluralBackupConfiguration, @@ -61,3 +62,23 @@ func (bc BackupConfiguration) CustomResourceDefinition() *apiextensions.CustomRe }, }) } + +// OffshootLabels return labels consist of the labels provided by user to BackupConfiguration crd and +// stash specific generic labels. It overwrites the the user provided labels if it matched with stash specific generic labels. +func (b BackupConfiguration) OffshootLabels() map[string]string { + overrides := make(map[string]string) + overrides[meta_util.ComponentLabelKey] = StashBackupComponent + overrides[meta_util.ManagedByLabelKey] = StashKey + + return upsertLabels(b.Labels, overrides) +} + +func upsertLabels(originalLabels, overrides map[string]string) map[string]string { + if originalLabels == nil { + originalLabels = make(map[string]string, len(overrides)) + } + for k, v := range overrides { + originalLabels[k] = v + } + return originalLabels +} diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/restore_session_helpers.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/restore_session_helpers.go index 612b87366..996ea4a6f 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/restore_session_helpers.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/restore_session_helpers.go @@ -7,6 +7,7 @@ import ( apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" hashutil "k8s.io/kubernetes/pkg/util/hash" crdutils "kmodules.xyz/client-go/apiextensions/v1beta1" + meta_util "kmodules.xyz/client-go/meta" "stash.appscode.dev/stash/apis" ) @@ -16,7 +17,7 @@ func (r RestoreSession) GetSpecHash() string { return strconv.FormatUint(hash.Sum64(), 10) } -func (c RestoreSession) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (r RestoreSession) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crdutils.NewCustomResourceDefinition(crdutils.Config{ Group: SchemeGroupVersion.Group, Plural: ResourcePluralRestoreSession, @@ -58,3 +59,13 @@ func (c RestoreSession) CustomResourceDefinition() *apiextensions.CustomResource }, }) } + +// OffshootLabels return labels consist of the labels provided by user to BackupConfiguration crd and +// stash specific generic labels. It overwrites the the user provided labels if it matched with stash specific generic labels. +func (r RestoreSession) OffshootLabels() map[string]string { + overrides := make(map[string]string) + overrides[meta_util.ComponentLabelKey] = StashRestoreComponent + overrides[meta_util.ManagedByLabelKey] = StashKey + + return upsertLabels(r.Labels, overrides) +} diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go index 8853b0b96..2710e7c2c 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go @@ -1,5 +1,10 @@ package v1beta1 +const ( + StashBackupComponent = "stash-backup" + StashRestoreComponent = "stash-restore" +) + // TODO: complete func (t TargetRef) IsWorkload() bool { if t.Kind == "Deployment" { diff --git a/vendor/stash.appscode.dev/stash/apis/util.go b/vendor/stash.appscode.dev/stash/apis/util.go index 39074c6e0..6641787ab 100644 --- a/vendor/stash.appscode.dev/stash/apis/util.go +++ b/vendor/stash.appscode.dev/stash/apis/util.go @@ -7,6 +7,8 @@ var ( const ( StashKey = "stash.appscode.com" VersionTag = StashKey + "/tag" + + KeyDeleteJobOnCompletion = StashKey + "/delete-job-on-completion" ) const ( @@ -19,11 +21,3 @@ const ( KindAppBinding = "AppBinding" KindDeploymentConfig = "DeploymentConfig" ) - -const ( - APIVersionAppsV1 = "apps/v1" - APIVersionAppsV1beta1 = "apps/v1beta1" - APIVersionAppsV1beta2 = "apps/v1beta2" - APIVersionCoreV1 = "v1" - APIVersionExtensionV1beta1 = "extensions/v1beta1" -) diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go new file mode 100644 index 000000000..7e895da4d --- /dev/null +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go @@ -0,0 +1,81 @@ +package util + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" + "github.com/golang/glog" + kerr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + kutil "kmodules.xyz/client-go" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" +) + +func CreateOrPatchBackupConfiguration(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api.BackupConfiguration) *api.BackupConfiguration) (*api.BackupConfiguration, kutil.VerbType, error) { + cur, err := c.BackupConfigurations(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(err) { + glog.V(3).Infof("Creating BackupConfiguration %s/%s.", meta.Namespace, meta.Name) + out, err := c.BackupConfigurations(meta.Namespace).Create(transform(&api.BackupConfiguration{ + TypeMeta: metav1.TypeMeta{ + Kind: "BackupConfiguration", + APIVersion: api.SchemeGroupVersion.String(), + }, + ObjectMeta: meta, + })) + return out, kutil.VerbCreated, err + } else if err != nil { + return nil, kutil.VerbUnchanged, err + } + return PatchBackupConfiguration(c, cur, transform) +} + +func PatchBackupConfiguration(c cs.StashV1beta1Interface, cur *api.BackupConfiguration, transform func(*api.BackupConfiguration) *api.BackupConfiguration) (*api.BackupConfiguration, kutil.VerbType, error) { + return PatchBackupConfigurationObject(c, cur, transform(cur.DeepCopy())) +} + +func PatchBackupConfigurationObject(c cs.StashV1beta1Interface, cur, mod *api.BackupConfiguration) (*api.BackupConfiguration, kutil.VerbType, error) { + curJson, err := json.Marshal(cur) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + modJson, err := json.Marshal(mod) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + patch, err := jsonpatch.CreateMergePatch(curJson, modJson) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + if len(patch) == 0 || string(patch) == "{}" { + return cur, kutil.VerbUnchanged, nil + } + glog.V(3).Infof("Patching BackupConfiguration %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) + out, err := c.BackupConfigurations(cur.Namespace).Patch(cur.Name, types.MergePatchType, patch) + return out, kutil.VerbPatched, err +} + +func TryUpdateBackupConfiguration(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(*api.BackupConfiguration) *api.BackupConfiguration) (result *api.BackupConfiguration, err error) { + attempt := 0 + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + cur, e2 := c.BackupConfigurations(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(e2) { + return false, e2 + } else if e2 == nil { + result, e2 = c.BackupConfigurations(cur.Namespace).Update(transform(cur.DeepCopy())) + return e2 == nil, nil + } + glog.Errorf("Attempt %d failed to update BackupConfiguration %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) + return false, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update BackupConfiguration %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) + } + return +} diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfigurationtemplate.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfigurationtemplate.go new file mode 100644 index 000000000..c68d11eb7 --- /dev/null +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfigurationtemplate.go @@ -0,0 +1,81 @@ +package util + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" + "github.com/golang/glog" + kerr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + kutil "kmodules.xyz/client-go" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" +) + +func CreateOrPatchBackupTemplate(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api.BackupConfigurationTemplate) *api.BackupConfigurationTemplate) (*api.BackupConfigurationTemplate, kutil.VerbType, error) { + cur, err := c.BackupConfigurationTemplates().Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(err) { + glog.V(3).Infof("Creating BackupConfigurationTemplate %s/%s.", meta.Namespace, meta.Name) + out, err := c.BackupConfigurationTemplates().Create(transform(&api.BackupConfigurationTemplate{ + TypeMeta: metav1.TypeMeta{ + Kind: "BackupConfigurationTemplate", + APIVersion: api.SchemeGroupVersion.String(), + }, + ObjectMeta: meta, + })) + return out, kutil.VerbCreated, err + } else if err != nil { + return nil, kutil.VerbUnchanged, err + } + return PatchBackupTemplate(c, cur, transform) +} + +func PatchBackupTemplate(c cs.StashV1beta1Interface, cur *api.BackupConfigurationTemplate, transform func(*api.BackupConfigurationTemplate) *api.BackupConfigurationTemplate) (*api.BackupConfigurationTemplate, kutil.VerbType, error) { + return PatchBackupTemplateObject(c, cur, transform(cur.DeepCopy())) +} + +func PatchBackupTemplateObject(c cs.StashV1beta1Interface, cur, mod *api.BackupConfigurationTemplate) (*api.BackupConfigurationTemplate, kutil.VerbType, error) { + curJson, err := json.Marshal(cur) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + modJson, err := json.Marshal(mod) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + patch, err := jsonpatch.CreateMergePatch(curJson, modJson) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + if len(patch) == 0 || string(patch) == "{}" { + return cur, kutil.VerbUnchanged, nil + } + glog.V(3).Infof("Patching BackupConfigurationTemplate %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) + out, err := c.BackupConfigurationTemplates().Patch(cur.Name, types.MergePatchType, patch) + return out, kutil.VerbPatched, err +} + +func TryUpdateBackupTemplate(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(*api.BackupConfigurationTemplate) *api.BackupConfigurationTemplate) (result *api.BackupConfigurationTemplate, err error) { + attempt := 0 + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + cur, e2 := c.BackupConfigurationTemplates().Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(e2) { + return false, e2 + } else if e2 == nil { + result, e2 = c.BackupConfigurationTemplates().Update(transform(cur.DeepCopy())) + return e2 == nil, nil + } + glog.Errorf("Attempt %d failed to update BackupConfigurationTemplate %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) + return false, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update BackupConfigurationTemplate %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) + } + return +} diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go new file mode 100644 index 000000000..3119f317c --- /dev/null +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go @@ -0,0 +1,153 @@ +package util + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" + "github.com/golang/glog" + "github.com/pkg/errors" + kerr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + kutil "kmodules.xyz/client-go" + "stash.appscode.dev/stash/apis" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" +) + +func CreateOrPatchBackupSession(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(bs *api_v1beta1.BackupSession) *api_v1beta1.BackupSession) (*api_v1beta1.BackupSession, kutil.VerbType, error) { + cur, err := c.BackupSessions(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(err) { + glog.V(3).Infof("Creating BackupSession %s/%s.", meta.Namespace, meta.Name) + out, err := c.BackupSessions(meta.Namespace).Create(transform(&api_v1beta1.BackupSession{ + TypeMeta: metav1.TypeMeta{ + Kind: api_v1beta1.ResourceKindBackupSession, + APIVersion: api_v1beta1.SchemeGroupVersion.String(), + }, + ObjectMeta: meta, + })) + return out, kutil.VerbCreated, err + } else if err != nil { + return nil, kutil.VerbUnchanged, err + } + return PatchBackupSession(c, cur, transform) +} + +func PatchBackupSession(c cs.StashV1beta1Interface, cur *api_v1beta1.BackupSession, transform func(*api_v1beta1.BackupSession) *api_v1beta1.BackupSession) (*api_v1beta1.BackupSession, kutil.VerbType, error) { + return PatchBackupSessionObject(c, cur, transform(cur.DeepCopy())) +} + +func PatchBackupSessionObject(c cs.StashV1beta1Interface, cur, mod *api_v1beta1.BackupSession) (*api_v1beta1.BackupSession, kutil.VerbType, error) { + curJson, err := json.Marshal(cur) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + modJson, err := json.Marshal(mod) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + patch, err := jsonpatch.CreateMergePatch(curJson, modJson) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + if len(patch) == 0 || string(patch) == "{}" { + return cur, kutil.VerbUnchanged, nil + } + glog.V(3).Infof("Patching BackupSession %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) + out, err := c.BackupSessions(cur.Namespace).Patch(cur.Name, types.MergePatchType, patch) + return out, kutil.VerbPatched, err +} + +func TryUpdateBackupSession(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(*api_v1beta1.BackupSession) *api_v1beta1.BackupSession) (result *api_v1beta1.BackupSession, err error) { + attempt := 0 + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + cur, e2 := c.BackupSessions(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(e2) { + return false, e2 + } else if e2 == nil { + result, e2 = c.BackupSessions(cur.Namespace).Update(transform(cur.DeepCopy())) + return e2 == nil, nil + } + glog.Errorf("Attempt %d failed to update BackupSession %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) + return false, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update BackupSession %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) + } + return +} + +func UpdateBackupSessionStatusForHost(c cs.StashV1beta1Interface, backupSession *api_v1beta1.BackupSession, hostStats api_v1beta1.HostBackupStats) (*api_v1beta1.BackupSession, error) { + + out, err := UpdateBackupSessionStatus(c, backupSession, func(in *api_v1beta1.BackupSessionStatus) *api_v1beta1.BackupSessionStatus { + // if an entry already exist for this host then update it + for i, v := range backupSession.Status.Stats { + if v.Hostname == hostStats.Hostname { + in.Stats[i] = hostStats + return in + } + } + // no entry for this host. so add a new entry. + in.Stats = append(in.Stats, hostStats) + return in + }, apis.EnableStatusSubresource) + return out, err +} + +func UpdateBackupSessionStatus( + c cs.StashV1beta1Interface, + in *api_v1beta1.BackupSession, + transform func(*api_v1beta1.BackupSessionStatus) *api_v1beta1.BackupSessionStatus, + useSubresource ...bool, +) (result *api_v1beta1.BackupSession, err error) { + if len(useSubresource) > 1 { + return nil, errors.Errorf("invalid value passed for useSubresource: %v", useSubresource) + } + apply := func(x *api_v1beta1.BackupSession) *api_v1beta1.BackupSession { + out := &api_v1beta1.BackupSession{ + TypeMeta: x.TypeMeta, + ObjectMeta: x.ObjectMeta, + Spec: x.Spec, + Status: *transform(in.Status.DeepCopy()), + } + return out + } + + if len(useSubresource) == 1 && useSubresource[0] { + attempt := 0 + cur := in.DeepCopy() + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + var e2 error + result, e2 = c.BackupSessions(in.Namespace).UpdateStatus(apply(cur)) + if kerr.IsConflict(e2) { + latest, e3 := c.BackupSessions(in.Namespace).Get(in.Name, metav1.GetOptions{}) + switch { + case e3 == nil: + cur = latest + return false, nil + case kutil.IsRequestRetryable(e3): + return false, nil + default: + return false, e3 + } + } else if err != nil && !kutil.IsRequestRetryable(e2) { + return false, e2 + } + return e2 == nil, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update status of BackupSession %s/%s after %d attempts due to %v", in.Namespace, in.Name, attempt, err) + } + return + } + + result, _, err = PatchBackupSessionObject(c, in, apply(in)) + return +} diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go new file mode 100644 index 000000000..5081fd292 --- /dev/null +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go @@ -0,0 +1,81 @@ +package util + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" + "github.com/golang/glog" + kerr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + kutil "kmodules.xyz/client-go" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" +) + +func CreateOrPatchFunction(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(fn *api.Function) *api.Function) (*api.Function, kutil.VerbType, error) { + cur, err := c.Functions().Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(err) { + glog.V(3).Infof("Creating Function %s/%s.", meta.Namespace, meta.Name) + out, err := c.Functions().Create(transform(&api.Function{ + TypeMeta: metav1.TypeMeta{ + Kind: "Function", + APIVersion: api.SchemeGroupVersion.String(), + }, + ObjectMeta: meta, + })) + return out, kutil.VerbCreated, err + } else if err != nil { + return nil, kutil.VerbUnchanged, err + } + return PatchFunction(c, cur, transform) +} + +func PatchFunction(c cs.StashV1beta1Interface, cur *api.Function, transform func(*api.Function) *api.Function) (*api.Function, kutil.VerbType, error) { + return PatchFunctionObject(c, cur, transform(cur.DeepCopy())) +} + +func PatchFunctionObject(c cs.StashV1beta1Interface, cur, mod *api.Function) (*api.Function, kutil.VerbType, error) { + curJson, err := json.Marshal(cur) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + modJson, err := json.Marshal(mod) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + patch, err := jsonpatch.CreateMergePatch(curJson, modJson) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + if len(patch) == 0 || string(patch) == "{}" { + return cur, kutil.VerbUnchanged, nil + } + glog.V(3).Infof("Patching Function %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) + out, err := c.Functions().Patch(cur.Name, types.MergePatchType, patch) + return out, kutil.VerbPatched, err +} + +func TryUpdateFunction(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(*api.Function) *api.Function) (result *api.Function, err error) { + attempt := 0 + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + cur, e2 := c.Functions().Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(e2) { + return false, e2 + } else if e2 == nil { + result, e2 = c.Functions().Update(transform(cur.DeepCopy())) + return e2 == nil, nil + } + glog.Errorf("Attempt %d failed to update Function %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) + return false, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update Function %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) + } + return +} diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go new file mode 100644 index 000000000..d5380f6bb --- /dev/null +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go @@ -0,0 +1,32 @@ +package util + +import ( + "fmt" + "reflect" + + jsoniter "github.com/json-iterator/go" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/runtime/schema" + "kmodules.xyz/client-go/meta" + api "stash.appscode.dev/stash/apis/stash/v1alpha1" +) + +var json = jsoniter.ConfigFastest + +func GetGroupVersionKind(v interface{}) schema.GroupVersionKind { + return api.SchemeGroupVersion.WithKind(meta.GetKind(v)) +} + +func AssignTypeKind(v interface{}) error { + if reflect.ValueOf(v).Kind() != reflect.Ptr { + return fmt.Errorf("%v must be a pointer", v) + } + + switch u := v.(type) { + case *api.Restic: + u.APIVersion = api.SchemeGroupVersion.String() + u.Kind = meta.GetKind(v) + return nil + } + return errors.New("unknown api object type") +} diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go new file mode 100644 index 000000000..083c9425b --- /dev/null +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go @@ -0,0 +1,152 @@ +package util + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" + "github.com/golang/glog" + "github.com/pkg/errors" + kerr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + kutil "kmodules.xyz/client-go" + "stash.appscode.dev/stash/apis" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" +) + +func CreateOrPatchRestoreSession(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api_v1beta1.RestoreSession) *api_v1beta1.RestoreSession) (*api_v1beta1.RestoreSession, kutil.VerbType, error) { + cur, err := c.RestoreSessions(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(err) { + glog.V(3).Infof("Creating RestoreSession %s/%s.", meta.Namespace, meta.Name) + out, err := c.RestoreSessions(meta.Namespace).Create(transform(&api_v1beta1.RestoreSession{ + TypeMeta: metav1.TypeMeta{ + Kind: api_v1beta1.ResourceKindRestoreSession, + APIVersion: api_v1beta1.SchemeGroupVersion.String(), + }, + ObjectMeta: meta, + })) + return out, kutil.VerbCreated, err + } else if err != nil { + return nil, kutil.VerbUnchanged, err + } + return PatchRestoreSession(c, cur, transform) +} + +func PatchRestoreSession(c cs.StashV1beta1Interface, cur *api_v1beta1.RestoreSession, transform func(*api_v1beta1.RestoreSession) *api_v1beta1.RestoreSession) (*api_v1beta1.RestoreSession, kutil.VerbType, error) { + return PatchRestoreSessionObject(c, cur, transform(cur.DeepCopy())) +} + +func PatchRestoreSessionObject(c cs.StashV1beta1Interface, cur, mod *api_v1beta1.RestoreSession) (*api_v1beta1.RestoreSession, kutil.VerbType, error) { + curJson, err := json.Marshal(cur) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + modJson, err := json.Marshal(mod) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + patch, err := jsonpatch.CreateMergePatch(curJson, modJson) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + if len(patch) == 0 || string(patch) == "{}" { + return cur, kutil.VerbUnchanged, nil + } + glog.V(3).Infof("Patching RestoreSession %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) + out, err := c.RestoreSessions(cur.Namespace).Patch(cur.Name, types.MergePatchType, patch) + return out, kutil.VerbPatched, err +} + +func TryUpdateRestoreSession(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(*api_v1beta1.RestoreSession) *api_v1beta1.RestoreSession) (result *api_v1beta1.RestoreSession, err error) { + attempt := 0 + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + cur, e2 := c.RestoreSessions(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(e2) { + return false, e2 + } else if e2 == nil { + result, e2 = c.RestoreSessions(cur.Namespace).Update(transform(cur.DeepCopy())) + return e2 == nil, nil + } + glog.Errorf("Attempt %d failed to update RestoreSession %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) + return false, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update RestoreSession %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) + } + return +} + +func UpdateRestoreSessionStatusForHost(c cs.StashV1beta1Interface, restoreSession *api_v1beta1.RestoreSession, hostStats api_v1beta1.HostRestoreStats) (*api_v1beta1.RestoreSession, error) { + out, err := UpdateRestoreSessionStatus(c, restoreSession, func(in *api_v1beta1.RestoreSessionStatus) *api_v1beta1.RestoreSessionStatus { + // if an entry already exist for this host then update it + for i, v := range restoreSession.Status.Stats { + if v.Hostname == hostStats.Hostname { + in.Stats[i] = hostStats + return in + } + } + // no entry for this host. so add a new entry. + in.Stats = append(in.Stats, hostStats) + return in + }, apis.EnableStatusSubresource) + return out, err +} + +func UpdateRestoreSessionStatus( + c cs.StashV1beta1Interface, + in *api_v1beta1.RestoreSession, + transform func(*api_v1beta1.RestoreSessionStatus) *api_v1beta1.RestoreSessionStatus, + useSubresource ...bool, +) (result *api_v1beta1.RestoreSession, err error) { + if len(useSubresource) > 1 { + return nil, errors.Errorf("invalid value passed for useSubresource: %v", useSubresource) + } + apply := func(x *api_v1beta1.RestoreSession) *api_v1beta1.RestoreSession { + out := &api_v1beta1.RestoreSession{ + TypeMeta: x.TypeMeta, + ObjectMeta: x.ObjectMeta, + Spec: x.Spec, + Status: *transform(in.Status.DeepCopy()), + } + return out + } + + if len(useSubresource) == 1 && useSubresource[0] { + attempt := 0 + cur := in.DeepCopy() + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + var e2 error + result, e2 = c.RestoreSessions(in.Namespace).UpdateStatus(apply(cur)) + if kerr.IsConflict(e2) { + latest, e3 := c.RestoreSessions(in.Namespace).Get(in.Name, metav1.GetOptions{}) + switch { + case e3 == nil: + cur = latest + return false, nil + case kutil.IsRequestRetryable(e3): + return false, nil + default: + return false, e3 + } + } else if err != nil && !kutil.IsRequestRetryable(e2) { + return false, e2 + } + return e2 == nil, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update status of RestoreSession %s/%s after %d attempts due to %v", in.Namespace, in.Name, attempt, err) + } + return + } + + result, _, err = PatchRestoreSessionObject(c, in, apply(in)) + return +} diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go new file mode 100644 index 000000000..c865d7616 --- /dev/null +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go @@ -0,0 +1,81 @@ +package util + +import ( + "fmt" + + jsonpatch "github.com/evanphx/json-patch" + "github.com/golang/glog" + kerr "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/wait" + kutil "kmodules.xyz/client-go" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" +) + +func CreateOrPatchTask(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api.Task) *api.Task) (*api.Task, kutil.VerbType, error) { + cur, err := c.Tasks().Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(err) { + glog.V(3).Infof("Creating Task %s/%s.", meta.Namespace, meta.Name) + out, err := c.Tasks().Create(transform(&api.Task{ + TypeMeta: metav1.TypeMeta{ + Kind: "Task", + APIVersion: api.SchemeGroupVersion.String(), + }, + ObjectMeta: meta, + })) + return out, kutil.VerbCreated, err + } else if err != nil { + return nil, kutil.VerbUnchanged, err + } + return PatchTask(c, cur, transform) +} + +func PatchTask(c cs.StashV1beta1Interface, cur *api.Task, transform func(*api.Task) *api.Task) (*api.Task, kutil.VerbType, error) { + return PatchTaskObject(c, cur, transform(cur.DeepCopy())) +} + +func PatchTaskObject(c cs.StashV1beta1Interface, cur, mod *api.Task) (*api.Task, kutil.VerbType, error) { + curJson, err := json.Marshal(cur) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + modJson, err := json.Marshal(mod) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + + patch, err := jsonpatch.CreateMergePatch(curJson, modJson) + if err != nil { + return nil, kutil.VerbUnchanged, err + } + if len(patch) == 0 || string(patch) == "{}" { + return cur, kutil.VerbUnchanged, nil + } + glog.V(3).Infof("Patching Task %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) + out, err := c.Tasks().Patch(cur.Name, types.MergePatchType, patch) + return out, kutil.VerbPatched, err +} + +func TryUpdateTask(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(*api.Task) *api.Task) (result *api.Task, err error) { + attempt := 0 + err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { + attempt++ + cur, e2 := c.Tasks().Get(meta.Name, metav1.GetOptions{}) + if kerr.IsNotFound(e2) { + return false, e2 + } else if e2 == nil { + result, e2 = c.Tasks().Update(transform(cur.DeepCopy())) + return e2 == nil, nil + } + glog.Errorf("Attempt %d failed to update Task %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) + return false, nil + }) + + if err != nil { + err = fmt.Errorf("failed to update Task %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) + } + return +} diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/backup.go b/vendor/stash.appscode.dev/stash/pkg/restic/backup.go index 5c38b04eb..9e6fd827a 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/backup.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/backup.go @@ -1,11 +1,16 @@ package restic import ( + "sync" "time" + "github.com/appscode/go/types" + "k8s.io/apimachinery/pkg/util/errors" api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) +// RunBackup takes backup, cleanup old snapshots, check repository integrity etc. +// It extract valuable information from respective restic command it runs and return them for further use. func (w *ResticWrapper) RunBackup(backupOption BackupOptions) (*BackupOutput, error) { // Start clock to measure total session duration startTime := time.Now() @@ -16,35 +21,14 @@ func (w *ResticWrapper) RunBackup(backupOption BackupOptions) (*BackupOutput, er return nil, err } - backupOutput := &BackupOutput{ - HostBackupStats: api_v1beta1.HostBackupStats{ - Hostname: backupOption.Host, - }, - } + backupOutput := &BackupOutput{} - if backupOption.StdinPipeCommand.Name != "" { // Backup from stdin - out, err := w.backupFromStdin(backupOption) - if err != nil { - return nil, err - } - // Extract information from the output of backup command - err = backupOutput.extractBackupInfo(out, backupOption.StdinFileName, backupOption.Host) - if err != nil { - return nil, err - } - } else { // Backup all target directories - for _, dir := range backupOption.BackupDirs { - out, err := w.backup(dir, backupOption.Host, nil) - if err != nil { - return nil, err - } - // Extract information from the output of backup command - err = backupOutput.extractBackupInfo(out, dir, backupOption.Host) - if err != nil { - return nil, err - } - } + // Run backup + hostStats, err := w.runBackup(backupOption) + if err != nil { + return nil, err } + backupOutput.HostBackupStats = []api_v1beta1.HostBackupStats{hostStats} // Check repository integrity out, err := w.check() @@ -52,35 +36,218 @@ func (w *ResticWrapper) RunBackup(backupOption BackupOptions) (*BackupOutput, er return nil, err } // Extract information from output of "check" command - backupOutput.extractCheckInfo(out) + integrity := extractCheckInfo(out) + backupOutput.RepositoryStats.Integrity = types.BoolP(integrity) - // Cleanup old snapshot according to retention policy - out, err = w.cleanup(backupOption.RetentionPolicy) + // Cleanup old snapshots according to retention policy + out, err = w.cleanup(backupOption.RetentionPolicy, "") if err != nil { return nil, err } // Extract information from output of cleanup command - err = backupOutput.extractCleanupInfo(out) + kept, removed, err := extractCleanupInfo(out) if err != nil { return nil, err } + backupOutput.RepositoryStats.SnapshotCount = kept + backupOutput.RepositoryStats.SnapshotsRemovedOnLastCleanup = removed // Read repository statics after cleanup - out, err = w.stats() + out, err = w.stats("") if err != nil { return nil, err } // Extract information from output of "stats" command - err = backupOutput.extractStatsInfo(out) + repoSize, err := extractStatsInfo(out) + if err != nil { + return nil, err + } + backupOutput.RepositoryStats.Size = repoSize + + for idx := range backupOutput.HostBackupStats { + if backupOutput.HostBackupStats[idx].Hostname == backupOption.Host { + backupOutput.HostBackupStats[idx].Duration = time.Since(startTime).String() + backupOutput.HostBackupStats[idx].Phase = api_v1beta1.HostBackupSucceeded + } + } + + return backupOutput, nil +} + +// RunParallelBackup runs multiple backup in parallel. +// Host must be different for each backup. +func (w *ResticWrapper) RunParallelBackup(backupOptions []BackupOptions, maxConcurrency int) (*BackupOutput, error) { + + // Initialize restic repository if it does not exist + _, err := w.initRepositoryIfAbsent() + if err != nil { + return nil, err + } + + // WaitGroup to wait until all go routine finish + wg := sync.WaitGroup{} + // concurrencyLimiter channel is used to limit maximum number simultaneous go routine + concurrencyLimiter := make(chan bool, maxConcurrency) + defer close(concurrencyLimiter) + + var ( + backupErrs []error + mu sync.Mutex // use lock to avoid racing condition + ) + + backupOutput := &BackupOutput{} + + for i := range backupOptions { + // try to send message in concurrencyLimiter channel. + // if maximum allowed concurrent backup is already running, program control will stuck here. + concurrencyLimiter <- true + + // starting new go routine. add it to WaitGroup + wg.Add(1) + + go func(opt BackupOptions, startTime time.Time) { + + // when this go routine completes it task, release a slot from the concurrencyLimiter channel + // so that another go routine can start. Also, tell the WaitGroup that it is done with its task. + defer func() { + <-concurrencyLimiter + wg.Done() + }() + + // sh field in ResticWrapper is a pointer. we must not use same w in multiple go routine. + // otherwise they might enter in a racing condition. + nw := w.Copy() + + hostStats, err := nw.runBackup(opt) + if err != nil { + // acquire lock to make sure no other go routine is writing to backupErr + mu.Lock() + backupErrs = append(backupErrs, err) + mu.Unlock() + return + } + hostStats.Duration = time.Since(startTime).String() + hostStats.Phase = api_v1beta1.HostBackupSucceeded + + // add hostStats to backupOutput. use lock to avoid racing condition. + mu.Lock() + backupOutput.upsertHostBackupStats(hostStats) + mu.Unlock() + }(backupOptions[i], time.Now()) + } + + // wait for all the go routines to complete + wg.Wait() + + if backupErrs != nil { + return nil, errors.NewAggregate(backupErrs) + } + + // Check repository integrity + out, err := w.check() if err != nil { return nil, err } + // Extract information from output of "check" command + integrity := extractCheckInfo(out) + backupOutput.RepositoryStats.Integrity = types.BoolP(integrity) - // Backup complete. Read current time and calculate total backup duration. - endTime := time.Now() - backupOutput.HostBackupStats.Duration = endTime.Sub(startTime).String() - backupOutput.HostBackupStats.Phase = api_v1beta1.HostBackupSucceeded + // Cleanup old snapshots according to retention policy + backupOutput.RepositoryStats.SnapshotCount = 0 + backupOutput.RepositoryStats.SnapshotsRemovedOnLastCleanup = 0 + for _, opt := range backupOptions { + out, err = w.cleanup(opt.RetentionPolicy, opt.Host) + if err != nil { + return nil, err + } + // Extract information from output of cleanup command + kept, removed, err := extractCleanupInfo(out) + if err != nil { + return nil, err + } + backupOutput.RepositoryStats.SnapshotCount += kept + backupOutput.RepositoryStats.SnapshotsRemovedOnLastCleanup += removed + } + + // Read repository statics after cleanup + out, err = w.stats("") + if err != nil { + return nil, err + } + + // Extract information from output of "stats" command + repoSize, err := extractStatsInfo(out) + if err != nil { + return nil, err + } + backupOutput.RepositoryStats.Size = repoSize return backupOutput, nil } + +func (w *ResticWrapper) runBackup(backupOption BackupOptions) (api_v1beta1.HostBackupStats, error) { + hostStats := api_v1beta1.HostBackupStats{ + Hostname: backupOption.Host, + } + + //fmt.Println("shell: ",w) + // Backup from stdin + if backupOption.StdinPipeCommand.Name != "" { + out, err := w.backupFromStdin(backupOption) + if err != nil { + return hostStats, err + } + // Extract information from the output of backup command + snapStats, err := extractBackupInfo(out, backupOption.StdinFileName, backupOption.Host) + if err != nil { + return hostStats, err + } + hostStats.Snapshots = []api_v1beta1.SnapshotStats{snapStats} + return hostStats, nil + } + + // Backup all target directories + for _, dir := range backupOption.BackupDirs { + out, err := w.backup(dir, backupOption.Host, nil) + if err != nil { + return hostStats, err + } + // Extract information from the output of backup command + stats, err := extractBackupInfo(out, dir, backupOption.Host) + if err != nil { + return hostStats, err + } + hostStats = upsertSnapshotStats(hostStats, stats) + } + + return hostStats, nil +} + +func upsertSnapshotStats(hostStats api_v1beta1.HostBackupStats, snapStats api_v1beta1.SnapshotStats) api_v1beta1.HostBackupStats { + for i, s := range hostStats.Snapshots { + // if there is already an entry for this snapshot, then update it + if s.Name == snapStats.Name { + hostStats.Snapshots[i] = snapStats + return hostStats + } + } + // no entry for this snapshot. add a new entry + hostStats.Snapshots = append(hostStats.Snapshots, snapStats) + return hostStats +} + +func (backupOutput *BackupOutput) upsertHostBackupStats(hostStats api_v1beta1.HostBackupStats) { + + // check if a entry already exist for this host in backupOutput. If exist then update it. + for i, v := range backupOutput.HostBackupStats { + if v.Hostname == hostStats.Hostname { + backupOutput.HostBackupStats[i] = hostStats + return + } + } + + // no entry for this host. add a new entry + backupOutput.HostBackupStats = append(backupOutput.HostBackupStats, hostStats) + return +} diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/commands.go b/vendor/stash.appscode.dev/stash/pkg/restic/commands.go index fc3ae6bb8..2e5fd3607 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/commands.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/commands.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "os" + "os/exec" "path/filepath" "strconv" "strings" @@ -17,8 +18,6 @@ import ( const ( ResticCMD = "/bin/restic_0.9.5" - IONiceCMD = "/bin/ionice" - NiceCMD = "/bin/nice" ) type Snapshot struct { @@ -122,11 +121,16 @@ func (w *ResticWrapper) backupFromStdin(options BackupOptions) ([]byte, error) { return w.run(commands...) } -func (w *ResticWrapper) cleanup(retentionPolicy v1alpha1.RetentionPolicy) ([]byte, error) { +func (w *ResticWrapper) cleanup(retentionPolicy v1alpha1.RetentionPolicy, host string) ([]byte, error) { log.Infoln("Cleaning old snapshots according to retention policy") args := []interface{}{"forget", "--quiet", "--json"} + if host != "" { + args = append(args, "--host") + args = append(args, host) + } + if retentionPolicy.KeepLast > 0 { args = append(args, string(v1alpha1.KeepLast)) args = append(args, strconv.Itoa(retentionPolicy.KeepLast)) @@ -248,9 +252,12 @@ func (w *ResticWrapper) check() ([]byte, error) { return w.run(Command{Name: ResticCMD, Args: args}) } -func (w *ResticWrapper) stats() ([]byte, error) { +func (w *ResticWrapper) stats(snapshotID string) ([]byte, error) { log.Infoln("Reading repository status") args := w.appendCacheDirFlag([]interface{}{"stats"}) + if snapshotID != "" { + args = append(args, snapshotID) + } args = w.appendMaxConnectionsFlag(args) args = append(args, "--quiet", "--json") args = w.appendCaCertFlag(args) @@ -318,7 +325,14 @@ func (w *ResticWrapper) run(commands ...Command) ([]byte, error) { for _, cmd := range commands { if cmd.Name == ResticCMD { // first apply NiceSettings, then apply IONiceSettings - cmd = w.applyIONiceSettings(w.applyNiceSettings(cmd)) + cmd, err = w.applyNiceSettings(cmd) + if err != nil { + return nil, err + } + cmd, err = w.applyIONiceSettings(cmd) + if err != nil { + return nil, err + } } w.sh.Command(cmd.Name, cmd.Args...) } @@ -339,9 +353,15 @@ func formatError(err error, stdErr string) error { return err } -func (w *ResticWrapper) applyIONiceSettings(oldCommand Command) Command { +func (w *ResticWrapper) applyIONiceSettings(oldCommand Command) (Command, error) { if w.config.IONice == nil { - return oldCommand + return oldCommand, nil + } + + // detect "ionice" installation path + IONiceCMD, err := exec.LookPath("ionice") + if err != nil { + return Command{}, err } newCommand := Command{ Name: IONiceCMD, @@ -358,12 +378,18 @@ func (w *ResticWrapper) applyIONiceSettings(oldCommand Command) Command { // append oldCommand as args of newCommand newCommand.Args = append(newCommand.Args, oldCommand.Name) newCommand.Args = append(newCommand.Args, oldCommand.Args...) - return newCommand + return newCommand, nil } -func (w *ResticWrapper) applyNiceSettings(oldCommand Command) Command { +func (w *ResticWrapper) applyNiceSettings(oldCommand Command) (Command, error) { if w.config.Nice == nil { - return oldCommand + return oldCommand, nil + } + + // detect "nice" installation path + NiceCMD, err := exec.LookPath("nice") + if err != nil { + return Command{}, err } newCommand := Command{ Name: NiceCMD, @@ -375,5 +401,5 @@ func (w *ResticWrapper) applyNiceSettings(oldCommand Command) Command { // append oldCommand as args of newCommand newCommand.Args = append(newCommand.Args, oldCommand.Name) newCommand.Args = append(newCommand.Args, oldCommand.Args...) - return newCommand + return newCommand, nil } diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/config.go b/vendor/stash.appscode.dev/stash/pkg/restic/config.go index 8be041bb2..90579791c 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/config.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/config.go @@ -106,3 +106,30 @@ func (w *ResticWrapper) GetRepo() string { } return "" } + +// Copy function copy input ResticWrapper and returns a new wrapper with copy of its content. +func (w *ResticWrapper) Copy() *ResticWrapper { + if w == nil { + return nil + } + out := new(ResticWrapper) + + if w.sh != nil { + out.sh = shell.NewSession() + + // set values in.sh to out.sh + for k, v := range w.sh.Env { + out.sh.Env[k] = v + } + // don't use same stdin, stdout, stderr for each instant to avoid data race. + //out.sh.Stdin = in.sh.Stdin + //out.sh.Stdout = in.sh.Stdout + //out.sh.Stderr = in.sh.Stderr + out.sh.ShowCMD = w.sh.ShowCMD + out.sh.PipeFail = w.sh.PipeFail + out.sh.PipeStdErrors = w.sh.PipeStdErrors + + } + out.config = w.config + return out +} diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go b/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go index 50d025256..d40e5e6f6 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go @@ -8,17 +8,18 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/push" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) +// BackupMetrics defines prometheus metrics for backup setup and individual host backup type BackupMetrics struct { // BackupSetupMetrics indicates whether backup was successfully setup for the target BackupSetupMetrics prometheus.Gauge - // BackupSessionMetrics shows metrics related to last backup session - BackupSessionMetrics *BackupSessionMetrics - // RepositoryMetrics shows metrics related to repository after last backup - RepositoryMetrics *RepositoryMetrics + // HostBackupMetrics shows metrics related to last backup session of a host + HostBackupMetrics *HostBackupMetrics } +// RestoreMetrics defines metrics for restore process for individual hosts type RestoreMetrics struct { // RestoreSuccess show whether the current restore session succeeded or not RestoreSuccess prometheus.Gauge @@ -26,10 +27,11 @@ type RestoreMetrics struct { SessionDuration prometheus.Gauge } -type BackupSessionMetrics struct { - // BackupSuccess show whether the current backup session succeeded or not +// HostBackupMetrics defines Prometheus metrics for backup individual hosts +type HostBackupMetrics struct { + // BackupSuccess show whether the current backup for a host succeeded or not BackupSuccess prometheus.Gauge - // SessionDuration show total time taken to complete the restore session + // SessionDuration show total time taken to complete the backup session SessionDuration prometheus.Gauge // DataSize shows total size of the target data to backup (in bytes) DataSize prometheus.Gauge @@ -41,6 +43,7 @@ type BackupSessionMetrics struct { FileMetrics *FileMetrics } +// FileMetrics defines Prometheus metrics for target files of a backup process type FileMetrics struct { // TotalFiles shows total number of files that has been backed up TotalFiles prometheus.Gauge @@ -52,6 +55,7 @@ type FileMetrics struct { UnmodifiedFiles prometheus.Gauge } +// RepositoryMetrics defines Prometheus metrics for Repository state after each backup type RepositoryMetrics struct { // RepoIntegrity shows result of repository integrity check after last backup RepoIntegrity prometheus.Gauge @@ -66,16 +70,7 @@ type RepositoryMetrics struct { func newBackupMetrics(labels prometheus.Labels) *BackupMetrics { return &BackupMetrics{ - BackupSetupMetrics: prometheus.NewGauge( - prometheus.GaugeOpts{ - Namespace: "stash", - Subsystem: "backup", - Name: "setup_success", - Help: "Indicates whether backup was successfully setup for the target", - ConstLabels: labels, - }, - ), - BackupSessionMetrics: &BackupSessionMetrics{ + HostBackupMetrics: &HostBackupMetrics{ BackupSuccess: prometheus.NewGauge( prometheus.GaugeOpts{ Namespace: "stash", @@ -160,44 +155,6 @@ func newBackupMetrics(labels prometheus.Labels) *BackupMetrics { ), }, }, - RepositoryMetrics: &RepositoryMetrics{ - RepoIntegrity: prometheus.NewGauge( - prometheus.GaugeOpts{ - Namespace: "stash", - Subsystem: "repository", - Name: "integrity", - Help: "Result of repository integrity check after last backup", - ConstLabels: labels, - }, - ), - RepoSize: prometheus.NewGauge( - prometheus.GaugeOpts{ - Namespace: "stash", - Subsystem: "repository", - Name: "size_bytes", - Help: "Indicates size of repository after last backup (in bytes)", - ConstLabels: labels, - }, - ), - SnapshotCount: prometheus.NewGauge( - prometheus.GaugeOpts{ - Namespace: "stash", - Subsystem: "repository", - Name: "snapshot_count", - Help: "Indicates number of snapshots stored in the repository", - ConstLabels: labels, - }, - ), - SnapshotsRemovedOnLastCleanup: prometheus.NewGauge( - prometheus.GaugeOpts{ - Namespace: "stash", - Subsystem: "repository", - Name: "snapshot_cleaned", - Help: "Indicates number of old snapshots cleaned up according to retention policy on last backup session", - ConstLabels: labels, - }, - ), - }, } } @@ -215,6 +172,49 @@ func newBackupSetupMetrics(labels prometheus.Labels) *BackupMetrics { ), } } + +func newRepositoryMetrics(labels prometheus.Labels) *RepositoryMetrics { + + return &RepositoryMetrics{ + RepoIntegrity: prometheus.NewGauge( + prometheus.GaugeOpts{ + Namespace: "stash", + Subsystem: "repository", + Name: "integrity", + Help: "Result of repository integrity check after last backup", + ConstLabels: labels, + }, + ), + RepoSize: prometheus.NewGauge( + prometheus.GaugeOpts{ + Namespace: "stash", + Subsystem: "repository", + Name: "size_bytes", + Help: "Indicates size of repository after last backup (in bytes)", + ConstLabels: labels, + }, + ), + SnapshotCount: prometheus.NewGauge( + prometheus.GaugeOpts{ + Namespace: "stash", + Subsystem: "repository", + Name: "snapshot_count", + Help: "Indicates number of snapshots stored in the repository", + ConstLabels: labels, + }, + ), + SnapshotsRemovedOnLastCleanup: prometheus.NewGauge( + prometheus.GaugeOpts{ + Namespace: "stash", + Subsystem: "repository", + Name: "snapshot_cleaned", + Help: "Indicates number of old snapshots cleaned up according to retention policy on last backup session", + ConstLabels: labels, + }, + ), + } +} + func newRestoreMetrics(labels prometheus.Labels) *RestoreMetrics { return &RestoreMetrics{ @@ -239,6 +239,7 @@ func newRestoreMetrics(labels prometheus.Labels) *RestoreMetrics { } } +// HandleBackupSetupMetrics generate and send Prometheus metrics for backup setup func HandleBackupSetupMetrics(metricOpt MetricsOptions, setupErr error) error { labels := metricLabels(metricOpt.Labels) metrics := newBackupSetupMetrics(labels) @@ -258,46 +259,61 @@ func HandleBackupSetupMetrics(metricOpt MetricsOptions, setupErr error) error { return metricOpt.sendMetrics(registry, metricOpt.JobName) } +// HandleMetrics generate and send Prometheus metrics for backup process func (backupOutput *BackupOutput) HandleMetrics(metricOpt *MetricsOptions, backupErr error) error { if backupOutput == nil { return fmt.Errorf("invalid backup output") } - // add host name as label - metricOpt.Labels = append(metricOpt.Labels, fmt.Sprintf("Host=%s", backupOutput.HostBackupStats.Hostname)) - labels := metricLabels(metricOpt.Labels) - metrics := newBackupMetrics(labels) + // create metric registry + registry := prometheus.NewRegistry() - if backupErr == nil { - // set metrics values from backupOutput - err := metrics.setValues(backupOutput) - if err != nil { - return err + // create metrics for individual hosts + for _, hostStats := range backupOutput.HostBackupStats { + // add host name as label + metricOpt.Labels = append(metricOpt.Labels, fmt.Sprintf("Host=%s", hostStats.Hostname)) + labels := metricLabels(metricOpt.Labels) + metrics := newBackupMetrics(labels) + + if backupErr == nil && hostStats.Error == "" { + // set metrics values from backupOutput + err := metrics.setValues(hostStats) + if err != nil { + return err + } + metrics.HostBackupMetrics.BackupSuccess.Set(1) + } else { + metrics.HostBackupMetrics.BackupSuccess.Set(0) } - metrics.BackupSessionMetrics.BackupSuccess.Set(1) - } else { - metrics.BackupSessionMetrics.BackupSuccess.Set(0) + registry.MustRegister( + // register backup session metrics + metrics.HostBackupMetrics.BackupSuccess, + metrics.HostBackupMetrics.SessionDuration, + metrics.HostBackupMetrics.FileMetrics.TotalFiles, + metrics.HostBackupMetrics.FileMetrics.NewFiles, + metrics.HostBackupMetrics.FileMetrics.ModifiedFiles, + metrics.HostBackupMetrics.FileMetrics.UnmodifiedFiles, + metrics.HostBackupMetrics.DataSize, + metrics.HostBackupMetrics.DataUploaded, + metrics.HostBackupMetrics.DataProcessingTime, + ) } - // create metric registry - registry := prometheus.NewRegistry() + // crete repository metrics + repoMetrics := newRepositoryMetrics(metricLabels(metricOpt.Labels)) + err := repoMetrics.setValues(backupOutput.RepositoryStats) + if err != nil { + return err + } + + // register repository metrics registry.MustRegister( - // register backup session metrics - metrics.BackupSessionMetrics.BackupSuccess, - metrics.BackupSessionMetrics.SessionDuration, - metrics.BackupSessionMetrics.FileMetrics.TotalFiles, - metrics.BackupSessionMetrics.FileMetrics.NewFiles, - metrics.BackupSessionMetrics.FileMetrics.ModifiedFiles, - metrics.BackupSessionMetrics.FileMetrics.UnmodifiedFiles, - metrics.BackupSessionMetrics.DataSize, - metrics.BackupSessionMetrics.DataUploaded, - metrics.BackupSessionMetrics.DataProcessingTime, - // register repository metrics - metrics.RepositoryMetrics.RepoIntegrity, - metrics.RepositoryMetrics.RepoSize, - metrics.RepositoryMetrics.SnapshotCount, - metrics.RepositoryMetrics.SnapshotsRemovedOnLastCleanup, + repoMetrics.RepoIntegrity, + repoMetrics.RepoSize, + repoMetrics.SnapshotCount, + repoMetrics.SnapshotsRemovedOnLastCleanup, ) + return metricOpt.sendMetrics(registry, metricOpt.JobName) } @@ -305,35 +321,37 @@ func (restoreOutput *RestoreOutput) HandleMetrics(metricOpt *MetricsOptions, res if restoreOutput == nil { return fmt.Errorf("invalid restore output") } - // add host name as label - metricOpt.Labels = append(metricOpt.Labels, fmt.Sprintf("Host=%s", restoreOutput.HostRestoreStats.Hostname)) - labels := metricLabels(metricOpt.Labels) - metrics := newRestoreMetrics(labels) - if restoreErr == nil { - duration, err := time.ParseDuration(restoreOutput.HostRestoreStats.Duration) - if err != nil { - return err + // create metric registry + registry := prometheus.NewRegistry() + + // create metrics for each host + for _, hostStats := range restoreOutput.HostRestoreStats { + // add host name as label + metricOpt.Labels = append(metricOpt.Labels, fmt.Sprintf("Host=%s", hostStats.Hostname)) + labels := metricLabels(metricOpt.Labels) + metrics := newRestoreMetrics(labels) + + if restoreErr == nil && hostStats.Error == "" { + duration, err := time.ParseDuration(hostStats.Duration) + if err != nil { + return err + } + metrics.SessionDuration.Set(duration.Seconds()) + metrics.RestoreSuccess.Set(1) + } else { + metrics.RestoreSuccess.Set(0) } - metrics.SessionDuration.Set(duration.Seconds()) - metrics.RestoreSuccess.Set(1) - } else { - metrics.RestoreSuccess.Set(0) + registry.MustRegister( + metrics.SessionDuration, + metrics.RestoreSuccess, + ) } - // create metric registry - registry := prometheus.NewRegistry() - registry.MustRegister( - metrics.SessionDuration, - metrics.RestoreSuccess, - ) return metricOpt.sendMetrics(registry, metricOpt.JobName) } -func (backupMetrics *BackupMetrics) setValues(backupOutput *BackupOutput) error { - if backupOutput == nil { - return nil - } +func (backupMetrics *BackupMetrics) setValues(hostOutput api_v1beta1.HostBackupStats) error { var ( totalDataSize float64 totalUploadSize float64 @@ -344,7 +362,7 @@ func (backupMetrics *BackupMetrics) setValues(backupOutput *BackupOutput) error totalUnmodifiedFiles int ) - for _, v := range backupOutput.HostBackupStats.Snapshots { + for _, v := range hostOutput.Snapshots { dataSizeBytes, err := convertSizeToBytes(v.Size) if err != nil { return err @@ -369,33 +387,38 @@ func (backupMetrics *BackupMetrics) setValues(backupOutput *BackupOutput) error totalUnmodifiedFiles = totalUnmodifiedFiles + *v.FileStats.UnmodifiedFiles } - backupMetrics.BackupSessionMetrics.DataSize.Set(totalDataSize) - backupMetrics.BackupSessionMetrics.DataUploaded.Set(totalUploadSize) - backupMetrics.BackupSessionMetrics.DataProcessingTime.Set(float64(totalProcessingTime)) - backupMetrics.BackupSessionMetrics.FileMetrics.TotalFiles.Set(float64(totalFiles)) - backupMetrics.BackupSessionMetrics.FileMetrics.NewFiles.Set(float64(totalNewFiles)) - backupMetrics.BackupSessionMetrics.FileMetrics.ModifiedFiles.Set(float64(totalModifiedFiles)) - backupMetrics.BackupSessionMetrics.FileMetrics.UnmodifiedFiles.Set(float64(totalUnmodifiedFiles)) + backupMetrics.HostBackupMetrics.DataSize.Set(totalDataSize) + backupMetrics.HostBackupMetrics.DataUploaded.Set(totalUploadSize) + backupMetrics.HostBackupMetrics.DataProcessingTime.Set(float64(totalProcessingTime)) + backupMetrics.HostBackupMetrics.FileMetrics.TotalFiles.Set(float64(totalFiles)) + backupMetrics.HostBackupMetrics.FileMetrics.NewFiles.Set(float64(totalNewFiles)) + backupMetrics.HostBackupMetrics.FileMetrics.ModifiedFiles.Set(float64(totalModifiedFiles)) + backupMetrics.HostBackupMetrics.FileMetrics.UnmodifiedFiles.Set(float64(totalUnmodifiedFiles)) - duration, err := time.ParseDuration(backupOutput.HostBackupStats.Duration) + duration, err := time.ParseDuration(hostOutput.Duration) if err != nil { return err } - backupMetrics.BackupSessionMetrics.SessionDuration.Set(duration.Seconds()) + backupMetrics.HostBackupMetrics.SessionDuration.Set(duration.Seconds()) + return nil +} + +func (repoMetrics *RepositoryMetrics) setValues(repoStats RepositoryStats) error { // set repository metrics values - if *backupOutput.RepositoryStats.Integrity { - backupMetrics.RepositoryMetrics.RepoIntegrity.Set(1) + if *repoStats.Integrity { + repoMetrics.RepoIntegrity.Set(1) } else { - backupMetrics.RepositoryMetrics.RepoIntegrity.Set(0) + repoMetrics.RepoIntegrity.Set(0) } - repoSize, err := convertSizeToBytes(backupOutput.RepositoryStats.Size) + repoSize, err := convertSizeToBytes(repoStats.Size) if err != nil { return err } - backupMetrics.RepositoryMetrics.RepoSize.Set(repoSize) - backupMetrics.RepositoryMetrics.SnapshotCount.Set(float64(backupOutput.RepositoryStats.SnapshotCount)) - backupMetrics.RepositoryMetrics.SnapshotsRemovedOnLastCleanup.Set(float64(backupOutput.RepositoryStats.SnapshotsRemovedOnLastCleanup)) + repoMetrics.RepoSize.Set(repoSize) + repoMetrics.SnapshotCount.Set(float64(repoStats.SnapshotCount)) + repoMetrics.SnapshotsRemovedOnLastCleanup.Set(float64(repoStats.SnapshotsRemovedOnLastCleanup)) + return nil } diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/output.go b/vendor/stash.appscode.dev/stash/pkg/restic/output.go index 343cdc1cf..be393983c 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/output.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/output.go @@ -10,13 +10,12 @@ import ( "path/filepath" "strings" - "github.com/appscode/go/types" api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) type BackupOutput struct { - // HostBackupStats shows backup statistics of current host - HostBackupStats api_v1beta1.HostBackupStats `json:"hostBackupStats,omitempty"` + // HostBackupStats shows backup statistics of a host + HostBackupStats []api_v1beta1.HostBackupStats `json:"hostBackupStats,omitempty"` // RepositoryStats shows statistics of repository after last backup RepositoryStats RepositoryStats `json:"repository,omitempty"` } @@ -33,8 +32,8 @@ type RepositoryStats struct { } type RestoreOutput struct { - // HostRestoreStats shows restore statistics of current host - HostRestoreStats api_v1beta1.HostRestoreStats `json:"hostRestoreStats,omitempty"` + // HostRestoreStats shows restore statistics of a host + HostRestoreStats []api_v1beta1.HostRestoreStats `json:"hostRestoreStats,omitempty"` } // WriteOutput write output of backup process into output.json file in the directory @@ -99,7 +98,11 @@ func ReadRestoreOutput(filename string) (*RestoreOutput, error) { // ExtractBackupInfo extract information from output of "restic backup" command and // save valuable information into backupOutput -func (backupOutput *BackupOutput) extractBackupInfo(output []byte, directory string, host string) error { +func extractBackupInfo(output []byte, directory string, hostname string) (api_v1beta1.SnapshotStats, error) { + snapshotStats := api_v1beta1.SnapshotStats{ + Directory: directory, + } + // unmarshal json output var jsonOutput BackupSummary dec := json.NewDecoder(bytes.NewReader(output)) @@ -111,7 +114,7 @@ func (backupOutput *BackupOutput) extractBackupInfo(output []byte, directory str break } if err != nil { - return err + return snapshotStats, err } // if message type is summary then we have found our desired message block if jsonOutput.MessageType == "summary" { @@ -119,10 +122,6 @@ func (backupOutput *BackupOutput) extractBackupInfo(output []byte, directory str } } - snapshotStats := api_v1beta1.SnapshotStats{ - Directory: directory, - } - snapshotStats.FileStats.NewFiles = jsonOutput.FilesNew snapshotStats.FileStats.ModifiedFiles = jsonOutput.FilesChanged snapshotStats.FileStats.UnmodifiedFiles = jsonOutput.FilesUnmodified @@ -133,65 +132,52 @@ func (backupOutput *BackupOutput) extractBackupInfo(output []byte, directory str snapshotStats.ProcessingTime = formatSeconds(uint64(jsonOutput.TotalDuration)) snapshotStats.Name = jsonOutput.SnapshotID - // if there is already an entry for this directory then update that - for i, v := range backupOutput.HostBackupStats.Snapshots { - if v.Directory == snapshotStats.Directory { - backupOutput.HostBackupStats.Snapshots[i] = snapshotStats - return nil - } - } - - // new entry. so append to backupOutput. - backupOutput.HostBackupStats.Snapshots = append(backupOutput.HostBackupStats.Snapshots, snapshotStats) - - return nil + return snapshotStats, nil } // ExtractCheckInfo extract information from output of "restic check" command and // save valuable information into backupOutput -func (backupOutput *BackupOutput) extractCheckInfo(out []byte) { +func extractCheckInfo(out []byte) bool { scanner := bufio.NewScanner(bytes.NewReader(out)) var line string for scanner.Scan() { line = scanner.Text() line = strings.TrimSpace(line) if line == "no errors were found" { - backupOutput.RepositoryStats.Integrity = types.BoolP(true) - return + return true } } - backupOutput.RepositoryStats.Integrity = types.BoolP(false) + return false } // ExtractCleanupInfo extract information from output of "restic forget" command and // save valuable information into backupOutput -func (backupOutput *BackupOutput) extractCleanupInfo(out []byte) error { +func extractCleanupInfo(out []byte) (int, int, error) { var fg []ForgetGroup err := json.Unmarshal(out, &fg) if err != nil { - return err + return 0, 0, err } - backupOutput.RepositoryStats.SnapshotsRemovedOnLastCleanup = 0 - backupOutput.RepositoryStats.SnapshotCount = 0 + keep := 0 + removed := 0 for i := 0; i < len(fg); i++ { - backupOutput.RepositoryStats.SnapshotsRemovedOnLastCleanup += len(fg[i].Remove) - backupOutput.RepositoryStats.SnapshotCount += len(fg[i].Keep) + keep += len(fg[i].Keep) + removed += len(fg[i].Remove) } - return nil + return keep, removed, nil } // ExtractStatsInfo extract information from output of "restic stats" command and // save valuable information into backupOutput -func (backupOutput *BackupOutput) extractStatsInfo(out []byte) error { +func extractStatsInfo(out []byte) (string, error) { var stat StatsContainer err := json.Unmarshal(out, &stat) if err != nil { - return err + return "", err } - backupOutput.RepositoryStats.Size = formatBytes(stat.TotalSize) - return nil + return formatBytes(stat.TotalSize), nil } type BackupSummary struct { diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/restore.go b/vendor/stash.appscode.dev/stash/pkg/restic/restore.go index 024838e8d..56e4fb5a1 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/restore.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/restore.go @@ -1,57 +1,214 @@ package restic import ( + "sync" "time" + "k8s.io/apimachinery/pkg/util/errors" api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) +// RunRestore run restore process for a single host. func (w *ResticWrapper) RunRestore(restoreOptions RestoreOptions) (*RestoreOutput, error) { // Start clock to measure total restore duration startTime := time.Now() + restoreStats := api_v1beta1.HostRestoreStats{ + Hostname: restoreOptions.Host, + } + + err := w.runRestore(restoreOptions) + if err != nil { + return nil, err + } + + // Restore successful. Now, calculate total session duration. + restoreStats.Duration = time.Since(startTime).String() + restoreStats.Phase = api_v1beta1.HostRestoreSucceeded + restoreOutput := &RestoreOutput{ - HostRestoreStats: api_v1beta1.HostRestoreStats{ - Hostname: restoreOptions.Host, - }, + HostRestoreStats: []api_v1beta1.HostRestoreStats{restoreStats}, } - if len(restoreOptions.Snapshots) != 0 { - for _, snapshot := range restoreOptions.Snapshots { - // if snapshot is specified then host and path does not matter. - if _, err := w.restore("", "", snapshot, restoreOptions.Destination); err != nil { - return nil, err + return restoreOutput, nil +} + +// RunParallelRestore run restore process for multiple hosts in parallel using go routine. +// You can control maximum number of parallel backup using maxConcurrency parameter. +func (w *ResticWrapper) RunParallelRestore(restoreOptions []RestoreOptions, maxConcurrency int) (*RestoreOutput, error) { + + // WaitGroup to wait until all go routine finish + wg := sync.WaitGroup{} + // concurrencyLimiter channel is used to limit maximum number simultaneous go routine + concurrencyLimiter := make(chan bool, maxConcurrency) + defer close(concurrencyLimiter) + + var ( + restoreErrs []error + mu sync.Mutex + ) + restoreOutput := &RestoreOutput{} + + for i := range restoreOptions { + // try to send message in concurrencyLimiter channel. + // if maximum allowed concurrent restore is already running, program control will stuck here. + concurrencyLimiter <- true + + // starting new go routine. add it to WaitGroup + wg.Add(1) + + go func(opt RestoreOptions, startTime time.Time) { + // when this go routine completes it task, release a slot from the concurrencyLimiter channel + // so that another go routine can start. Also, tell the WaitGroup that it is done with its task. + defer func() { + <-concurrencyLimiter + wg.Done() + }() + + // sh field in ResticWrapper is a pointer. we must not use same w in multiple go routine. + // otherwise they might enter in a racing condition. + nw := w.Copy() + + // run restore + err := nw.runRestore(opt) + if err != nil { + mu.Lock() + restoreErrs = append(restoreErrs, err) + mu.Unlock() + return } - } - } else if len(restoreOptions.RestoreDirs) != 0 { - for _, path := range restoreOptions.RestoreDirs { - if _, err := w.restore(path, restoreOptions.SourceHost, "", restoreOptions.Destination); err != nil { - return nil, err + hostStats := api_v1beta1.HostRestoreStats{ + Hostname: opt.Host, } - } + hostStats.Duration = time.Since(startTime).String() + hostStats.Phase = api_v1beta1.HostRestoreSucceeded + + // add hostStats to restoreOutput + mu.Lock() + restoreOutput.upsertHostRestoreStats(hostStats) + mu.Unlock() + }(restoreOptions[i], time.Now()) } - // Restore successful. Read current time and calculate total session duration. - endTime := time.Now() - restoreOutput.HostRestoreStats.Duration = endTime.Sub(startTime).String() - restoreOutput.HostRestoreStats.Phase = api_v1beta1.HostRestoreSucceeded + // wait for all the go routines to complete + wg.Wait() - return restoreOutput, nil + return restoreOutput, errors.NewAggregate(restoreErrs) } +// Dump run restore process for a single host and output the restored files in stdout. func (w *ResticWrapper) Dump(dumpOptions DumpOptions) (*RestoreOutput, error) { // Start clock to measure total restore duration startTime := time.Now() - restoreOutput := &RestoreOutput{} + restoreStats := api_v1beta1.HostRestoreStats{} if _, err := w.dump(dumpOptions); err != nil { return nil, err } - // Dump successful. Read current time and calculate total session duration. - endTime := time.Now() - restoreOutput.HostRestoreStats.Duration = endTime.Sub(startTime).String() - restoreOutput.HostRestoreStats.Phase = api_v1beta1.HostRestoreSucceeded + // Dump successful. Now, calculate total session duration. + restoreStats.Duration = time.Since(startTime).String() + restoreStats.Phase = api_v1beta1.HostRestoreSucceeded + restoreOutput := &RestoreOutput{ + HostRestoreStats: []api_v1beta1.HostRestoreStats{restoreStats}, + } return restoreOutput, nil } + +// ParallelDump run dump for multiple hosts concurrently using go routine. +// You can control maximum number of parallel restore process using maxConcurrency parameter. +func (w *ResticWrapper) ParallelDump(dumpOptions []DumpOptions, maxConcurrency int) (*RestoreOutput, error) { + + // WaitGroup to wait until all go routine finish + wg := sync.WaitGroup{} + // concurrencyLimiter channel is used to limit maximum number simultaneous go routine + concurrencyLimiter := make(chan bool, maxConcurrency) + defer close(concurrencyLimiter) + + var ( + restoreErrs []error + mu sync.Mutex + ) + + restoreOutput := &RestoreOutput{} + + for i := range dumpOptions { + // try to send message in concurrencyLimiter channel. + // if maximum allowed concurrent backup is already running, program control will stuck here. + concurrencyLimiter <- true + + // starting new go routine. add it to WaitGroup + wg.Add(1) + + go func(opt DumpOptions, startTime time.Time) { + // when this go routine completes it task, release a slot from the concurrencyLimiter channel + // so that another go routine can start. Also, tell the WaitGroup that it is done with its task. + defer func() { + <-concurrencyLimiter + wg.Done() + }() + + // sh field in ResticWrapper is a pointer. we must not use same w in multiple go routine. + // otherwise they might enter in a racing condition. + nw := w.Copy() + + // run restore + _, err := nw.dump(opt) + if err != nil { + mu.Lock() + restoreErrs = append(restoreErrs, err) + mu.Unlock() + return + } + hostStats := api_v1beta1.HostRestoreStats{ + Hostname: opt.Host, + } + hostStats.Duration = time.Since(startTime).String() + hostStats.Phase = api_v1beta1.HostRestoreSucceeded + + // add hostStats to restoreOutput + mu.Lock() + restoreOutput.upsertHostRestoreStats(hostStats) + mu.Unlock() + }(dumpOptions[i], time.Now()) + } + + // wait for all the go routines to complete + wg.Wait() + + return restoreOutput, errors.NewAggregate(restoreErrs) +} + +func (w *ResticWrapper) runRestore(restoreOptions RestoreOptions) error { + if len(restoreOptions.Snapshots) != 0 { + for _, snapshot := range restoreOptions.Snapshots { + // if snapshot is specified then host and path does not matter. + if _, err := w.restore("", "", snapshot, restoreOptions.Destination); err != nil { + return err + } + } + } else if len(restoreOptions.RestoreDirs) != 0 { + for _, path := range restoreOptions.RestoreDirs { + if _, err := w.restore(path, restoreOptions.SourceHost, "", restoreOptions.Destination); err != nil { + return err + } + } + } + return nil +} + +func (restoreOutput *RestoreOutput) upsertHostRestoreStats(hostStats api_v1beta1.HostRestoreStats) { + + // check if a entry already exist for this host in restoreOutput. If exist then update it. + for i, v := range restoreOutput.HostRestoreStats { + if v.Hostname == hostStats.Hostname { + restoreOutput.HostRestoreStats[i] = hostStats + return + } + } + + // no entry for this host. add a new entry + restoreOutput.HostRestoreStats = append(restoreOutput.HostRestoreStats, hostStats) + return +} diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/snapshot.go b/vendor/stash.appscode.dev/stash/pkg/restic/snapshot.go index 30fa19fc8..17d7a15f6 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/snapshot.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/snapshot.go @@ -1,5 +1,7 @@ package restic +import "encoding/json" + func (w *ResticWrapper) ListSnapshots(snapshotIDs []string) ([]Snapshot, error) { return w.listSnapshots(snapshotIDs) } @@ -7,3 +9,19 @@ func (w *ResticWrapper) ListSnapshots(snapshotIDs []string) ([]Snapshot, error) func (w *ResticWrapper) DeleteSnapshots(snapshotIDs []string) ([]byte, error) { return w.deleteSnapshots(snapshotIDs) } + +// GetSnapshotSize returns size of a snapshot in bytes +func (w *ResticWrapper) GetSnapshotSize(snapshotID string) (uint64, error) { + out, err := w.stats(snapshotID) + if err != nil { + return 0, err + } + + var stat StatsContainer + err = json.Unmarshal(out, &stat) + if err != nil { + return 0, err + } + return stat.TotalSize, nil + +} diff --git a/vendor/stash.appscode.dev/stash/pkg/util/crds.go b/vendor/stash.appscode.dev/stash/pkg/util/crds.go new file mode 100644 index 000000000..84215a841 --- /dev/null +++ b/vendor/stash.appscode.dev/stash/pkg/util/crds.go @@ -0,0 +1,274 @@ +package util + +import ( + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned" + util_v1beta1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util" + "stash.appscode.dev/stash/pkg/docker" +) + +// EnsureDefaultFunctions creates "update-status", "pvc-backup" and "pvc-restore" Functions if they are not already present +func EnsureDefaultFunctions(stashClient cs.Interface, registry, imageTag string) error { + image := docker.Docker{ + Registry: registry, + Image: docker.ImageStash, + Tag: imageTag, + } + + defaultFunctions := []*api_v1beta1.Function{ + updateStatusFunction(image), + pvcBackupFunction(image), + pvcRestoreFunction(image), + } + + for _, fn := range defaultFunctions { + _, _, err := util_v1beta1.CreateOrPatchFunction(stashClient.StashV1beta1(), fn.ObjectMeta, func(in *api_v1beta1.Function) *api_v1beta1.Function { + in.Spec = fn.Spec + return in + }) + if err != nil { + return err + } + } + return nil +} + +// EnsureDefaultTasks creates "pvc-backup" and "pvc-restore" Tasks if they are not already present +func EnsureDefaultTasks(stashClient cs.Interface) error { + defaultTasks := []*api_v1beta1.Task{ + pvcBackupTask(), + pvcRestoreTask(), + } + + for _, task := range defaultTasks { + _, _, err := util_v1beta1.CreateOrPatchTask(stashClient.StashV1beta1(), task.ObjectMeta, func(in *api_v1beta1.Task) *api_v1beta1.Task { + in.Spec = task.Spec + return in + }) + if err != nil { + return err + } + } + + return nil +} + +func updateStatusFunction(image docker.Docker) *api_v1beta1.Function { + return &api_v1beta1.Function{ + ObjectMeta: metav1.ObjectMeta{ + Name: "update-status", + }, + Spec: api_v1beta1.FunctionSpec{ + Image: image.ToContainerImage(), + Args: []string{ + "update-status", + "--namespace=${NAMESPACE:=default}", + "--backup-session=${BACKUP_SESSION:=}", + "--repository=${REPOSITORY_NAME:=}", + "--restore-session=${RESTORE_SESSION:=}", + "--output-dir=${outputDir:=}", + "--enable-status-subresource=${ENABLE_STATUS_SUBRESOURCE:=false}", + }, + }, + } +} + +func pvcBackupFunction(image docker.Docker) *api_v1beta1.Function { + return &api_v1beta1.Function{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pvc-backup", + }, + Spec: api_v1beta1.FunctionSpec{ + Image: image.ToContainerImage(), + Args: []string{ + "backup-pvc", + "--provider=${REPOSITORY_PROVIDER:=}", + "--bucket=${REPOSITORY_BUCKET:=}", + "--endpoint=${REPOSITORY_ENDPOINT:=}", + "--rest-server-url=${REPOSITORY_URL:=}", + "--path=${REPOSITORY_PREFIX:=}", + "--secret-dir=/etc/repository/secret", + "--scratch-dir=/tmp", + "--enable-cache=${ENABLE_CACHE:=true}", + "--max-connections=${MAX_CONNECTIONS:=0}", + "--hostname=${HOSTNAME:=}", + "--backup-dirs=${TARGET_DIRECTORIES}", + "--retention-keep-last=${RETENTION_KEEP_LAST:=0}", + "--retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0}", + "--retention-keep-daily=${RETENTION_KEEP_DAILY:=0}", + "--retention-keep-weekly=${RETENTION_KEEP_WEEKLY:=0}", + "--retention-keep-monthly=${RETENTION_KEEP_MONTHLY:=0}", + "--retention-keep-yearly=${RETENTION_KEEP_YEARLY:=0}", + "--retention-keep-tags=${RETENTION_KEEP_TAGS:=}", + "--retention-prune=${RETENTION_PRUNE:=false}", + "--retention-dry-run=${RETENTION_DRY_RUN:=false}", + "--output-dir=${outputDir:=}", + "--metrics-enabled=true", + "--metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=}", + }, + VolumeMounts: []core.VolumeMount{ + { + Name: "${targetVolume}", + MountPath: "${TARGET_MOUNT_PATH}", + }, + { + Name: "${secretVolume}", + MountPath: "/etc/repository/secret", + }, + }, + }, + } +} + +func pvcRestoreFunction(image docker.Docker) *api_v1beta1.Function { + return &api_v1beta1.Function{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pvc-restore", + }, + Spec: api_v1beta1.FunctionSpec{ + Image: image.ToContainerImage(), + Args: []string{ + "restore-pvc", + "--provider=${REPOSITORY_PROVIDER:=}", + "--bucket=${REPOSITORY_BUCKET:=}", + "--endpoint=${REPOSITORY_ENDPOINT:=}", + "--rest-server-url=${REPOSITORY_URL:=}", + "--path=${REPOSITORY_PREFIX:=}", + "--secret-dir=/etc/repository/secret", + "--scratch-dir=/tmp", + "--enable-cache=${ENABLE_CACHE:=true}", + "--max-connections=${MAX_CONNECTIONS:=0}", + "--hostname=${HOSTNAME:=}", + "--restore-dirs=${RESTORE_DIRECTORIES}", + "--snapshots=${RESTORE_SNAPSHOTS:=}", + "--output-dir=${outputDir:=}", + "--metrics-enabled=true", + "--metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=}", + }, + VolumeMounts: []core.VolumeMount{ + { + Name: "${targetVolume}", + MountPath: "${TARGET_MOUNT_PATH}", + }, + { + Name: "${secretVolume}", + MountPath: "/etc/repository/secret", + }, + }, + }, + } +} + +func pvcBackupTask() *api_v1beta1.Task { + return &api_v1beta1.Task{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pvc-backup", + }, + Spec: api_v1beta1.TaskSpec{ + Steps: []api_v1beta1.FunctionRef{ + { + Name: "pvc-backup", + Params: []api_v1beta1.Param{ + { + Name: "outputDir", + Value: "/tmp/output", + }, + { + Name: "targetVolume", + Value: "target-volume", + }, + { + Name: "secretVolume", + Value: "secret-volume", + }, + }, + }, + { + Name: "update-status", + Params: []api_v1beta1.Param{ + { + Name: "outputDir", + Value: "/tmp/output", + }, + }, + }, + }, + Volumes: []core.Volume{ + { + Name: "target-volume", + VolumeSource: core.VolumeSource{ + PersistentVolumeClaim: &core.PersistentVolumeClaimVolumeSource{ + ClaimName: "${TARGET_NAME}", + }, + }, + }, + { + Name: "secret-volume", + VolumeSource: core.VolumeSource{ + Secret: &core.SecretVolumeSource{ + SecretName: "${REPOSITORY_SECRET_NAME}", + }, + }, + }, + }, + }, + } +} + +func pvcRestoreTask() *api_v1beta1.Task { + return &api_v1beta1.Task{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pvc-restore", + }, + Spec: api_v1beta1.TaskSpec{ + Steps: []api_v1beta1.FunctionRef{ + { + Name: "pvc-restore", + Params: []api_v1beta1.Param{ + { + Name: "outputDir", + Value: "/tmp/output", + }, + { + Name: "targetVolume", + Value: "target-volume", + }, + { + Name: "secretVolume", + Value: "secret-volume", + }, + }, + }, + { + Name: "update-status", + Params: []api_v1beta1.Param{ + { + Name: "outputDir", + Value: "/tmp/output", + }, + }, + }, + }, + Volumes: []core.Volume{ + { + Name: "target-volume", + VolumeSource: core.VolumeSource{ + PersistentVolumeClaim: &core.PersistentVolumeClaimVolumeSource{ + ClaimName: "${TARGET_NAME}", + }, + }, + }, + { + Name: "secret-volume", + VolumeSource: core.VolumeSource{ + Secret: &core.SecretVolumeSource{ + SecretName: "${REPOSITORY_SECRET_NAME}", + }, + }, + }, + }, + }, + } +} diff --git a/vendor/stash.appscode.dev/stash/pkg/util/init_container.go b/vendor/stash.appscode.dev/stash/pkg/util/init_container.go index 498983ecd..b3c33feb1 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/init_container.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/init_container.go @@ -7,6 +7,7 @@ import ( core "k8s.io/api/core/v1" "kmodules.xyz/client-go/tools/cli" "kmodules.xyz/client-go/tools/clientcmd" + ofst_util "kmodules.xyz/offshoot-api/util" "stash.appscode.dev/stash/apis" v1alpha1_api "stash.appscode.dev/stash/apis/stash/v1alpha1" v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" @@ -95,17 +96,7 @@ func NewRestoreInitContainer(rs *v1beta1_api.RestoreSession, repository *v1alpha // pass container runtime settings from RestoreSession to init-container if rs.Spec.RuntimeSettings.Container != nil { - initContainer.Resources = rs.Spec.RuntimeSettings.Container.Resources - - if rs.Spec.RuntimeSettings.Container.LivenessProbe != nil { - initContainer.LivenessProbe = rs.Spec.RuntimeSettings.Container.LivenessProbe - } - if rs.Spec.RuntimeSettings.Container.ReadinessProbe != nil { - initContainer.ReadinessProbe = rs.Spec.RuntimeSettings.Container.ReadinessProbe - } - if rs.Spec.RuntimeSettings.Container.Lifecycle != nil { - initContainer.Lifecycle = rs.Spec.RuntimeSettings.Container.Lifecycle - } + initContainer = ofst_util.ApplyContainerRuntimeSettings(initContainer, *rs.Spec.RuntimeSettings.Container) } // In order to preserve file ownership, restore process need to be run as root user. @@ -117,9 +108,10 @@ func NewRestoreInitContainer(rs *v1beta1_api.RestoreSession, repository *v1alpha RunAsGroup: types.Int64P(0), } if rs.Spec.RuntimeSettings.Container != nil { - securityContext = UpsertSecurityContext(securityContext, rs.Spec.RuntimeSettings.Container.SecurityContext) + initContainer.SecurityContext = UpsertSecurityContext(securityContext, rs.Spec.RuntimeSettings.Container.SecurityContext) + } else { + initContainer.SecurityContext = securityContext } - initContainer.SecurityContext = UpsertSecurityContext(initContainer.SecurityContext, securityContext) return initContainer } diff --git a/vendor/stash.appscode.dev/stash/pkg/util/job.go b/vendor/stash.appscode.dev/stash/pkg/util/job.go index 7d7e54091..f09cb89c8 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/job.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/job.go @@ -3,27 +3,30 @@ package util import ( "fmt" + "github.com/appscode/go/types" batch "k8s.io/api/batch/v1" core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "kmodules.xyz/client-go/tools/analytics" "kmodules.xyz/client-go/tools/cli" "kmodules.xyz/client-go/tools/clientcmd" + ofst_util "kmodules.xyz/offshoot-api/util" "stash.appscode.dev/stash/apis" - api "stash.appscode.dev/stash/apis/stash/v1alpha1" + api_v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" cs "stash.appscode.dev/stash/client/clientset/versioned" "stash.appscode.dev/stash/pkg/docker" ) -func NewCheckJob(restic *api.Restic, hostName, smartPrefix string, image docker.Docker) *batch.Job { +func NewCheckJob(restic *api_v1alpha1.Restic, hostName, smartPrefix string, image docker.Docker) *batch.Job { job := &batch.Job{ ObjectMeta: metav1.ObjectMeta{ Name: CheckJobPrefix + restic.Name, Namespace: restic.Namespace, OwnerReferences: []metav1.OwnerReference{ { - APIVersion: api.SchemeGroupVersion.String(), - Kind: api.ResourceKindRestic, + APIVersion: api_v1alpha1.SchemeGroupVersion.String(), + Kind: api_v1alpha1.ResourceKindRestic, Name: restic.Name, UID: restic.UID, }, @@ -32,6 +35,8 @@ func NewCheckJob(restic *api.Restic, hostName, smartPrefix string, image docker. "app": AppLabelStash, AnnotationRestic: restic.Name, AnnotationOperation: OperationCheck, + // ensure that job gets deleted on completion + apis.KeyDeleteJobOnCompletion: "true", }, }, Spec: batch.JobSpec{ @@ -91,7 +96,7 @@ func NewCheckJob(restic *api.Restic, hostName, smartPrefix string, image docker. return job } -func NewRecoveryJob(stashClient cs.Interface, recovery *api.Recovery, image docker.Docker) (*batch.Job, error) { +func NewRecoveryJob(stashClient cs.Interface, recovery *api_v1alpha1.Recovery, image docker.Docker) (*batch.Job, error) { repository, err := stashClient.StashV1alpha1().Repositories(recovery.Spec.Repository.Namespace).Get(recovery.Spec.Repository.Name, metav1.GetOptions{}) if err != nil { return nil, err @@ -114,8 +119,8 @@ func NewRecoveryJob(stashClient cs.Interface, recovery *api.Recovery, image dock Namespace: recovery.Namespace, OwnerReferences: []metav1.OwnerReference{ { - APIVersion: api.SchemeGroupVersion.String(), - Kind: api.ResourceKindRecovery, + APIVersion: api_v1alpha1.SchemeGroupVersion.String(), + Kind: api_v1alpha1.ResourceKindRecovery, Name: recovery.Name, UID: recovery.UID, }, @@ -124,6 +129,8 @@ func NewRecoveryJob(stashClient cs.Interface, recovery *api.Recovery, image dock "app": AppLabelStash, AnnotationRecovery: recovery.Name, AnnotationOperation: OperationRecovery, + // ensure that the job gets deleted on completion + apis.KeyDeleteJobOnCompletion: "true", }, }, Spec: batch.JobSpec{ @@ -173,7 +180,7 @@ func NewRecoveryJob(stashClient cs.Interface, recovery *api.Recovery, image dock // local backend if repository.Spec.Backend.Local != nil { - w := &api.LocalTypedReference{ + w := &api_v1alpha1.LocalTypedReference{ Kind: repoLabelData.WorkloadKind, Name: repoLabelData.WorkloadName, } @@ -190,3 +197,169 @@ func NewRecoveryJob(stashClient cs.Interface, recovery *api.Recovery, image dock return job, nil } + +func NewPVCRestorerJob(rs *api_v1beta1.RestoreSession, repository *api_v1alpha1.Repository, image docker.Docker, meta metav1.ObjectMeta) (*core.PodTemplateSpec, error) { + container := core.Container{ + Name: StashContainer, + Image: image.ToContainerImage(), + Args: append([]string{ + "restore", + "--restore-session=" + rs.Name, + "--restore-model=job", + "--secret-dir=" + StashSecretMountDir, + fmt.Sprintf("--enable-cache=%v", !rs.Spec.TempDir.DisableCaching), + fmt.Sprintf("--max-connections=%v", GetMaxConnections(repository.Spec.Backend)), + "--metrics-enabled=true", + "--pushgateway-url=" + PushgatewayURL(), + fmt.Sprintf("--enable-status-subresource=%v", apis.EnableStatusSubresource), + fmt.Sprintf("--use-kubeapiserver-fqdn-for-aks=%v", clientcmd.UseKubeAPIServerFQDNForAKS()), + fmt.Sprintf("--enable-analytics=%v", cli.EnableAnalytics), + }, cli.LoggerOptions.ToFlags()...), + Env: []core.EnvVar{ + { + Name: KeyPodName, + Value: meta.Name, + }, + { + Name: KeyNodeName, + ValueFrom: &core.EnvVarSource{ + FieldRef: &core.ObjectFieldSelector{ + FieldPath: "spec.nodeName", + }, + }, + }, + }, + VolumeMounts: []core.VolumeMount{ + { + Name: StashSecretVolume, + MountPath: StashSecretMountDir, + }, + }, + } + + // mount tmp volume + container.VolumeMounts = UpsertTmpVolumeMount(container.VolumeMounts) + + // mount the volumes specified in RestoreSession into the job + for _, srcVol := range rs.Spec.Target.VolumeMounts { + container.VolumeMounts = append(container.VolumeMounts, core.VolumeMount{ + Name: srcVol.Name, + MountPath: srcVol.MountPath, + SubPath: srcVol.SubPath, + }) + } + + // if Repository uses local volume as backend, we have to mount it inside the initContainer + if repository.Spec.Backend.Local != nil { + _, mnt := repository.Spec.Backend.Local.ToVolumeAndMount(LocalVolumeName) + container.VolumeMounts = append(container.VolumeMounts, mnt) + } + + // Pass container RuntimeSettings from RestoreSession + if rs.Spec.RuntimeSettings.Container != nil { + container = ofst_util.ApplyContainerRuntimeSettings(container, *rs.Spec.RuntimeSettings.Container) + } + + // In order to preserve file ownership, restore process need to be run as root user. + // Stash image uses non-root user "stash"(1005). We have to use securityContext to run stash as root user. + // If a user specify securityContext either in pod level or container level in RuntimeSetting, + // don't overwrite that. In this case, user must take the responsibility of possible file ownership modification. + securityContext := &core.SecurityContext{ + RunAsUser: types.Int64P(0), + RunAsGroup: types.Int64P(0), + } + if rs.Spec.RuntimeSettings.Container != nil { + container.SecurityContext = UpsertSecurityContext(securityContext, rs.Spec.RuntimeSettings.Container.SecurityContext) + } else { + container.SecurityContext = securityContext + } + + jobTemplate := &core.PodTemplateSpec{ + Spec: core.PodSpec{ + Containers: []core.Container{container}, + RestartPolicy: core.RestartPolicyNever, + }, + } + + // Pass pod RuntimeSettings from RestoreSession + if rs.Spec.RuntimeSettings.Pod != nil { + jobTemplate.Spec = ofst_util.ApplyPodRuntimeSettings(jobTemplate.Spec, *rs.Spec.RuntimeSettings.Pod) + } + + // add an emptyDir volume for holding temporary files + jobTemplate.Spec.Volumes = UpsertTmpVolume(jobTemplate.Spec.Volumes, rs.Spec.TempDir) + // add storage secret as volume to the workload. this has been mounted on the container above. + jobTemplate.Spec.Volumes = UpsertSecretVolume(jobTemplate.Spec.Volumes, repository.Spec.Backend.StorageSecretName) + // if Repository uses local volume as backend, append this volume to the job + jobTemplate.Spec.Volumes = MergeLocalVolume(jobTemplate.Spec.Volumes, &repository.Spec.Backend) + + return jobTemplate, nil +} + +func NewVolumeSnapshotterJob(bs *api_v1beta1.BackupSession, bc *api_v1beta1.BackupConfiguration, image docker.Docker) (*core.PodTemplateSpec, error) { + container := core.Container{ + Name: StashContainer, + Image: image.ToContainerImage(), + Args: append([]string{ + "create-vs", + fmt.Sprintf("--backupsession.name=%s", bs.Name), + "--metrics-enabled=true", + "--pushgateway-url=" + PushgatewayURL(), + fmt.Sprintf("--enable-status-subresource=%v", apis.EnableStatusSubresource), + fmt.Sprintf("--use-kubeapiserver-fqdn-for-aks=%v", clientcmd.UseKubeAPIServerFQDNForAKS()), + fmt.Sprintf("--enable-analytics=%v", cli.EnableAnalytics), + }, cli.LoggerOptions.ToFlags()...), + } + + // Pass container RuntimeSettings from RestoreSession + if bc.Spec.RuntimeSettings.Container != nil { + container = ofst_util.ApplyContainerRuntimeSettings(container, *bc.Spec.RuntimeSettings.Container) + } + + jobTemplate := &core.PodTemplateSpec{ + Spec: core.PodSpec{ + Containers: []core.Container{container}, + RestartPolicy: core.RestartPolicyNever, + }, + } + + // Pass pod RuntimeSettings from RestoreSession + if bc.Spec.RuntimeSettings.Pod != nil { + jobTemplate.Spec = ofst_util.ApplyPodRuntimeSettings(jobTemplate.Spec, *bc.Spec.RuntimeSettings.Pod) + } + return jobTemplate, nil +} + +func NewVolumeRestorerJob(rs *api_v1beta1.RestoreSession, image docker.Docker) (*core.PodTemplateSpec, error) { + container := core.Container{ + Name: StashContainer, + Image: image.ToContainerImage(), + Args: append([]string{ + "restore-vs", + fmt.Sprintf("--restoresession.name=%s", rs.Name), + "--metrics-enabled=true", + "--pushgateway-url=" + PushgatewayURL(), + fmt.Sprintf("--enable-status-subresource=%v", apis.EnableStatusSubresource), + fmt.Sprintf("--use-kubeapiserver-fqdn-for-aks=%v", clientcmd.UseKubeAPIServerFQDNForAKS()), + fmt.Sprintf("--enable-analytics=%v", cli.EnableAnalytics), + }, cli.LoggerOptions.ToFlags()...), + } + + // Pass container RuntimeSettings from RestoreSession + if rs.Spec.RuntimeSettings.Container != nil { + container = ofst_util.ApplyContainerRuntimeSettings(container, *rs.Spec.RuntimeSettings.Container) + } + + jobTemplate := &core.PodTemplateSpec{ + Spec: core.PodSpec{ + Containers: []core.Container{container}, + RestartPolicy: core.RestartPolicyNever, + }, + } + + // Pass pod RuntimeSettings from RestoreSession + if rs.Spec.RuntimeSettings.Pod != nil { + jobTemplate.Spec = ofst_util.ApplyPodRuntimeSettings(jobTemplate.Spec, *rs.Spec.RuntimeSettings.Pod) + } + return jobTemplate, nil +} diff --git a/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go b/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go index 49d0a1b0f..f38cd9436 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go @@ -55,7 +55,7 @@ const ( ModelSidecar = "sidecar" ModelCronJob = "cronjob" LabelApp = "app" - LabelBackupConfiguration = "backup-configuration" + LabelBackupConfiguration = apis.StashKey + "/backup-configuration" StashSecretVolume = "stash-secret-volume" StashSecretMountDir = "/etc/stash/repository/secret" diff --git a/vendor/stash.appscode.dev/stash/pkg/util/restic.go b/vendor/stash.appscode.dev/stash/pkg/util/restic.go index 0dcdc89b3..89487f257 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/restic.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/restic.go @@ -86,8 +86,10 @@ func HandleResticError(outputDir, fileName string, backupErr error) error { } log.Infoln("Writing restic error to output file, error:", backupErr.Error()) backupOut := restic.BackupOutput{ - HostBackupStats: api_v1beta1.HostBackupStats{ - Error: backupErr.Error(), + HostBackupStats: []api_v1beta1.HostBackupStats{ + { + Error: backupErr.Error(), + }, }} return backupOut.WriteOutput(filepath.Join(outputDir, fileName)) } diff --git a/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go b/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go index 1b9af1f58..cac0b95f6 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go @@ -9,6 +9,7 @@ import ( "kmodules.xyz/client-go/tools/cli" "kmodules.xyz/client-go/tools/clientcmd" store "kmodules.xyz/objectstore-api/api/v1" + ofst_util "kmodules.xyz/offshoot-api/util" "stash.appscode.dev/stash/apis" api "stash.appscode.dev/stash/apis/stash/v1alpha1" v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" @@ -153,27 +154,7 @@ func NewBackupSidecarContainer(bc *v1beta1_api.BackupConfiguration, backend *sto } // pass container runtime settings from BackupConfiguration to sidecar if bc.Spec.RuntimeSettings.Container != nil { - // by default container will run as root - securityContext := &core.SecurityContext{ - RunAsUser: types.Int64P(0), - RunAsGroup: types.Int64P(0), - } - if bc.Spec.RuntimeSettings.Container.SecurityContext != nil { - securityContext = bc.Spec.RuntimeSettings.Container.SecurityContext - } - sidecar.SecurityContext = securityContext - - sidecar.Resources = bc.Spec.RuntimeSettings.Container.Resources - - if bc.Spec.RuntimeSettings.Container.LivenessProbe != nil { - sidecar.LivenessProbe = bc.Spec.RuntimeSettings.Container.LivenessProbe - } - if bc.Spec.RuntimeSettings.Container.ReadinessProbe != nil { - sidecar.ReadinessProbe = bc.Spec.RuntimeSettings.Container.ReadinessProbe - } - if bc.Spec.RuntimeSettings.Container.Lifecycle != nil { - sidecar.Lifecycle = bc.Spec.RuntimeSettings.Container.Lifecycle - } + sidecar = ofst_util.ApplyContainerRuntimeSettings(sidecar, *bc.Spec.RuntimeSettings.Container) } return sidecar } diff --git a/vendor/stash.appscode.dev/stash/pkg/util/util.go b/vendor/stash.appscode.dev/stash/pkg/util/util.go index 6734562ab..6e6803e4e 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/util.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/util.go @@ -19,6 +19,7 @@ import ( store "kmodules.xyz/objectstore-api/api/v1" v1 "kmodules.xyz/offshoot-api/api/v1" oc_cs "kmodules.xyz/openshift/client/clientset/versioned" + wapi "kmodules.xyz/webhook-runtime/apis/workload/v1" "stash.appscode.dev/stash/apis" api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" cs "stash.appscode.dev/stash/client/clientset/versioned" @@ -59,12 +60,23 @@ func GetHostName(target interface{}) (string, error) { if t == nil { return "host-0", nil } + // replicas is specified when restore StatefulSet volumes using job. + // so we have to handle this case too. + if t.Replicas != nil { // StatefulSet volumes. + podName := os.Getenv(KeyPodName) + if podName == "" { + return "", fmt.Errorf("missing podName for %s", apis.KindStatefulSet) + } + podInfo := strings.Split(podName, "-") + podOrdinal := podInfo[len(podInfo)-1] + return "host-" + podOrdinal, nil + } targetRef = t.Ref } switch targetRef.Kind { case apis.KindStatefulSet: - podName := os.Getenv("POD_NAME") + podName := os.Getenv(KeyPodName) if podName == "" { return "", fmt.Errorf("missing podName for %s", apis.KindStatefulSet) } @@ -72,7 +84,7 @@ func GetHostName(target interface{}) (string, error) { podOrdinal := podInfo[len(podInfo)-1] return "host-" + podOrdinal, nil case apis.KindDaemonSet: - nodeName := os.Getenv("NODE_NAME") + nodeName := os.Getenv(KeyNodeName) if nodeName == "" { return "", fmt.Errorf("missing nodeName for %s", apis.KindDaemonSet) } @@ -335,3 +347,56 @@ func (wc *WorkloadClients) IsTargetExist(target api_v1beta1.TargetRef, namespace } return false } + +// CreateBatchPVC creates a batch of PVCs whose definitions has been provided in pvcList argument +func CreateBatchPVC(kubeClient kubernetes.Interface, namespace string, pvcList []core.PersistentVolumeClaim) error { + for _, pvc := range pvcList { + _, err := kubeClient.CoreV1().PersistentVolumeClaims(namespace).Create(&pvc) + if err != nil { + return err + } + } + return nil +} + +// PVCListToVolumes return a list of volumes to mount in pod for a list of PVCs +func PVCListToVolumes(pvcList []core.PersistentVolumeClaim, ordinal int32) []core.Volume { + volList := make([]core.Volume, 0) + var volName string + for _, pvc := range pvcList { + volName = strings.TrimSuffix(pvc.Name, fmt.Sprintf("-%d", ordinal)) + volList = append(volList, core.Volume{ + Name: volName, + VolumeSource: core.VolumeSource{ + PersistentVolumeClaim: &core.PersistentVolumeClaimVolumeSource{ + ClaimName: pvc.Name, + }, + }, + }) + } + return volList +} + +func HasStashContainer(w *wapi.Workload) bool { + return HasStashSidecar(w.Spec.Template.Spec.Containers) || HasStashInitContainer(w.Spec.Template.Spec.InitContainers) +} + +func HasStashSidecar(containers []core.Container) bool { + // check if the workload has stash sidecar container + for _, c := range containers { + if c.Name == StashContainer { + return true + } + } + return false +} + +func HasStashInitContainer(containers []core.Container) bool { + // check if the workload has stash init-container + for _, c := range containers { + if c.Name == StashInitContainer { + return true + } + } + return false +}