From a8153dbf063f247b6b45c473d6490d28f8591aaf Mon Sep 17 00:00:00 2001 From: "Md. Emruz Hossain" Date: Sun, 7 Jun 2020 02:19:15 +0600 Subject: [PATCH] Make waitTimeout Configurable through flag (#22) Signed-off-by: hossainemruz --- Makefile | 6 +- api/crds/bindata.go | 12 +- ....appscode.com_stashelasticsearches.v1.yaml | 4 + ...ash.appscode.com_stashelasticsearches.yaml | 4 + api/openapi-spec/swagger.json | 7 +- apis/installer/v1alpha1/generated.pb.go | 114 +++++++++++------- apis/installer/v1alpha1/generated.proto | 2 + apis/installer/v1alpha1/openapi_generated.go | 8 +- .../v1alpha1/stash_elasticsearch_types.go | 1 + charts/stash-elasticsearch/README.md | 1 + .../elasticsearch-backup-function.yaml | 1 + .../elasticsearch-restore-function.yaml | 1 + .../values.openapiv3_schema.yaml | 4 + charts/stash-elasticsearch/values.yaml | 3 + pkg/backup.go | 4 +- pkg/restore.go | 5 + pkg/utils.go | 5 +- 17 files changed, 123 insertions(+), 59 deletions(-) diff --git a/Makefile b/Makefile index 865d32265..624f045ed 100644 --- a/Makefile +++ b/Makefile @@ -57,8 +57,8 @@ NEW_RESTIC_VER := 0.9.6 ### These variables should not need tweaking. ### -SRC_PKGS := cmd pkg -SRC_DIRS := $(SRC_PKGS) # directories which hold app source (not vendored) +SRC_PKGS := api apis cmd pkg +SRC_DIRS := $(SRC_PKGS) hack/gencrd # directories which hold app source (not vendored) DOCKER_PLATFORMS := linux/amd64 BIN_PLATFORMS := $(DOCKER_PLATFORMS) @@ -410,7 +410,7 @@ unit-tests: $(BUILD_DIRS) ARCH=$(ARCH) \ OS=$(OS) \ VERSION=$(VERSION) \ - ./hack/test.sh $(SRC_DIRS) \ + ./hack/test.sh $(SRC_PKGS) \ " .PHONY: ct diff --git a/api/crds/bindata.go b/api/crds/bindata.go index f3990c5aa..c153a590c 100644 --- a/api/crds/bindata.go +++ b/api/crds/bindata.go @@ -78,7 +78,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _installerStashAppscodeCom_stashelasticsearchesV1Yaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x54\xbd\x8e\x23\x37\x0c\xee\xfd\x14\x04\x52\x5c\x13\x8f\xb1\x48\x13\x4c\x17\x6c\xae\x38\xe4\x17\xe7\xc3\xf5\xb4\x44\x8f\x99\xd5\x48\x0a\x49\x19\xd9\x3c\x7d\x20\xcd\x78\xed\xb5\xbd\x4e\xce\xc8\xb1\x9a\xe1\x9f\xc8\xef\x23\x89\x99\x3f\x93\x28\xa7\xd8\x03\x66\xa6\xbf\x8c\x62\xfd\xd3\xee\xe9\x7b\xed\x38\xad\xf6\x0f\x8b\x27\x8e\xbe\x87\xc7\xa2\x96\xc6\x8f\xa4\xa9\x88\xa3\x1f\x69\xcb\x91\x8d\x53\x5c\x8c\x64\xe8\xd1\xb0\x5f\x00\x38\x21\xac\xca\x4f\x3c\x92\x1a\x8e\xb9\x87\x58\x42\x58\x00\x04\xdc\x50\xd0\xea\x03\x80\x39\xf7\xa0\x86\xba\x5b\x00\x44\x1c\x69\xfe\xa3\x80\x6a\xec\x94\x50\xdc\x8e\xb4\xe3\xa8\x86\x21\x90\x74\xcd\xdc\x61\xce\xea\x92\xa7\xce\xa5\x71\xa1\x99\x5c\x4d\x37\x48\x2a\xb9\x87\x9b\xbe\xd3\x2b\xf3\xeb\x0e\x8d\x86\x24\x7c\xf8\x5f\xbe\x94\x52\xbf\x0f\x71\xed\x77\xea\x7c\x5d\xcd\xef\x4f\x6b\x6b\xc6\xc0\x6a\x3f\xbd\xe1\xf0\x33\xab\x35\xa7\x1c\x8a\x60\xb8\xde\x5f\x73\x50\x8e\x43\x09\x28\xd7\x5c\x16\x00\xea\x52\xa6\x1e\x7e\xad\xe5\x67\x74\xe4\x17\x00\xfb\x89\xb0\x56\xfe\x72\xc6\x6f\xff\x80\x21\xef\xf0\x61\xca\xe9\x76\x34\xe2\xd4\x1d\x40\xca\x14\x7f\xf8\xfd\xc3\xe7\xef\xd6\xaf\xd4\x00\x59\x52\x26\xb1\x17\x20\x26\x39\x99\x88\x13\x2d\x80\x27\x75\xc2\xd9\xda\xa8\xbc\xab\x09\x27\x2f\xf0\x75\x14\x48\xc1\x76\x74\x28\x8d\xfc\x5c\x03\xa4\x2d\xd8\x8e\x15\x84\xb2\x90\x52\xb4\x36\x1e\xaf\x12\x43\x75\xc2\x08\x69\xf3\x07\x39\xeb\x60\x4d\x52\xd3\x80\xee\x52\x09\x1e\x5c\x8a\x7b\x12\x03\x21\x97\x86\xc8\x7f\xbf\xe4\x56\xb0\xd4\x1e\x0d\x68\x34\xc3\x7d\x14\x8e\x46\x12\x31\xc0\x1e\x43\xa1\x6f\x01\xa3\x87\x11\x9f\x41\xa8\xbe\x02\x25\x9e\xe4\x6b\x2e\xda\xc1\x2f\x49\x08\x38\x6e\x53\x0f\x3b\xb3\xac\xfd\x6a\x35\xb0\x1d\x36\xc1\xa5\x71\x2c\x91\xed\x79\xe5\x52\x34\xe1\x4d\xb1\x24\xba\xf2\xb4\xa7\xb0\x52\x1e\x96\x95\x32\x36\x72\x56\x84\x56\x98\x79\xd9\x4a\x8f\xd6\xd6\x69\xf4\xdf\xc8\xbc\x3b\xfa\xee\x55\xad\xf6\x9c\xdb\x02\x08\xc7\xe1\xc4\xd0\x66\xef\x06\x03\x75\xf4\x80\x15\x70\x0e\x9d\xba\x38\x02\x5d\x55\x15\x9d\x8f\xef\xd7\x9f\xe0\xf0\x74\x23\xe3\x1c\xfd\x86\xfb\x31\x50\x8f\x14\x54\xc0\x38\x6e\x49\x26\x12\xb7\x92\xc6\x96\x93\xa2\xcf\x89\xa3\xb5\x1f\x17\x98\xe2\x39\xfc\x5a\x36\x23\x5b\xe5\xfd\xcf\x42\x6a\x95\xab\x0e\x1e\x31\xc6\x64\xb0\x21\x28\xd9\xa3\x91\xef\xe0\x43\x84\x47\x1c\x29\x3c\xa2\xd2\x57\x27\xa0\x22\xad\xcb\x0a\xec\x7f\xa3\xe0\xf4\xb2\x9d\x3b\x4f\xa8\x9d\x18\x0e\xf7\xe8\x0d\xbe\x2e\x6f\xc4\x3a\x93\xab\x04\x56\x0c\xe7\x6d\xd9\x26\x99\x1c\xe1\xf2\xdc\x1c\x65\x1a\x57\xd8\x72\xa0\x57\x96\xeb\xfb\x5c\x65\x83\xee\xa9\xe4\x73\xed\xad\x88\x2a\x28\xc3\x55\xfd\x9b\x78\xdd\xc4\xa7\xca\xb6\x84\x50\xef\xd5\x6f\x7b\x12\x61\x4f\x97\xd9\x6f\x64\xe6\x11\x87\x2b\x11\xb7\x7b\x10\x1a\x58\x4d\x9e\xef\xe8\xa3\x06\xe7\xa4\x6c\xe9\xce\x70\xc3\xe1\x8e\xb8\xba\x31\x2c\xe4\x2f\x43\x97\x2f\xdd\x5c\x35\x1d\x6a\xbd\x62\x34\xfc\x22\x9a\xee\xa6\x48\x48\x2d\xc9\x17\x93\xf4\x7f\x0f\xda\x75\x08\x97\xf3\x1a\x9c\x29\xdb\x58\x9d\xe9\xe6\x3e\xfe\x7d\xed\x2f\x94\x5a\x2f\xa7\xef\xc1\xa4\x4c\xe1\x35\x51\x9d\xdb\x49\xf3\x4f\x00\x00\x00\xff\xff\x66\x2a\x11\x5d\x6f\x09\x00\x00") +var _installerStashAppscodeCom_stashelasticsearchesV1Yaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\x4b\x8f\xe3\x36\x0c\xbe\xfb\x57\x10\xe8\x61\x2f\x8d\x83\x45\x8b\xa2\xf0\xad\x98\xee\x61\xd1\x27\x36\x8b\xbd\x33\x32\xed\xb0\x23\x4b\x2a\x49\xa5\x9d\xfe\xfa\x42\xb2\x33\x79\x4e\xda\x1d\xb4\x3a\x45\x7c\x89\xfc\x3e\x92\x31\x26\xfe\x44\xa2\x1c\x43\x07\x98\x98\xfe\x34\x0a\xe5\xa6\xed\xe3\xb7\xda\x72\x5c\xef\xdf\x36\x8f\x1c\xfa\x0e\x1e\xb2\x5a\x9c\x3e\x90\xc6\x2c\x8e\xbe\xa7\x81\x03\x1b\xc7\xd0\x4c\x64\xd8\xa3\x61\xd7\x00\x38\x21\x2c\xc2\x8f\x3c\x91\x1a\x4e\xa9\x83\x90\xbd\x6f\x00\x3c\x6e\xc9\x6b\xb1\x01\xc0\x94\x3a\x50\x43\xdd\x35\x00\x01\x27\x5a\x6e\xe4\x51\x8d\x9d\x12\x8a\xdb\x91\xb6\x1c\xd4\xd0\x7b\x92\xb6\xaa\x5b\x4c\x49\x5d\xec\xa9\x75\x71\x6a\x34\x91\x2b\xe1\x46\x89\x39\x75\x70\xd7\x76\x7e\x65\x79\xdd\xa1\xd1\x18\x85\x0f\xf7\xd5\x73\x2a\xe5\xf7\xc1\xaf\x5e\xe7\xca\x37\x45\xfd\xee\x34\xb7\xaa\xf4\xac\xf6\xc3\x0b\x06\x3f\xb2\x5a\x35\x4a\x3e\x0b\xfa\xdb\xf5\x55\x03\xe5\x30\x66\x8f\x72\xcb\xa4\x01\x50\x17\x13\x75\xf0\x73\x49\x3f\xa1\xa3\xbe\x01\xd8\xcf\x84\xd5\xf4\x57\x0b\x7e\xfb\xb7\xe8\xd3\x0e\xdf\xce\x31\xdd\x8e\x26\x9c\xab\x03\x88\x89\xc2\x77\xbf\xbe\xff\xf4\xd5\xe6\x4c\x0c\x90\x24\x26\x12\x7b\x06\x62\x3e\x27\x1d\x71\x22\x05\xe8\x49\x9d\x70\xb2\xda\x2a\x6f\x4a\xc0\xd9\x0a\xfa\xd2\x0a\xa4\x60\x3b\x3a\xa4\x46\xfd\x92\x03\xc4\x01\x6c\xc7\x0a\x42\x49\x48\x29\x58\x6d\x8f\xb3\xc0\x50\x8c\x30\x40\xdc\xfe\x46\xce\x5a\xd8\x90\x94\x30\xa0\xbb\x98\x7d\x0f\x2e\x86\x3d\x89\x81\x90\x8b\x63\xe0\xbf\x9e\x63\x2b\x58\xac\x8f\x7a\x34\x5a\xe0\x3e\x1e\x0e\x46\x12\xd0\xc3\x1e\x7d\xa6\x2f\x01\x43\x0f\x13\x3e\x81\x50\x79\x05\x72\x38\x89\x57\x4d\xb4\x85\x9f\xa2\x10\x70\x18\x62\x07\x3b\xb3\xa4\xdd\x7a\x3d\xb2\x1d\x26\xc1\xc5\x69\xca\x81\xed\x69\xed\x62\x30\xe1\x6d\xb6\x28\xba\xee\x69\x4f\x7e\xad\x3c\xae\x0a\x65\x6c\xe4\x2c\x0b\xad\x31\xf1\xaa\xa6\x1e\xac\x8e\xd3\xd4\x7f\x21\xcb\xec\xe8\x9b\xb3\x5c\xed\x29\xd5\x01\x10\x0e\xe3\x89\xa2\xf6\xde\x1d\x06\x4a\xeb\x01\x2b\xe0\xe2\x3a\x57\x71\x04\xba\x88\x0a\x3a\x1f\xde\x6d\x3e\xc2\xe1\xe9\x4a\xc6\x25\xfa\x15\xf7\xa3\xa3\x1e\x29\x28\x80\x71\x18\x48\x66\x12\x07\x89\x53\x8d\x49\xa1\x4f\x91\x83\xd5\x8b\xf3\x4c\xe1\x12\x7e\xcd\xdb\x89\xad\xf0\xfe\x7b\x26\xb5\xc2\x55\x0b\x0f\x18\x42\x34\xd8\x12\xe4\xd4\xa3\x51\xdf\xc2\xfb\x00\x0f\x38\x91\x7f\x40\xa5\xff\x9d\x80\x82\xb4\xae\x0a\xb0\xff\x8e\x82\xd3\xcd\x76\x69\x3c\xa3\x76\xa2\x38\xec\xa3\x17\xf8\xba\xde\x11\x9b\x44\xae\x10\x58\x30\x5c\xa6\x65\x88\x32\x1b\xc2\xf5\xba\x39\x9e\xb9\x5d\x61\x60\x4f\x67\x9a\xdb\xf3\x5c\xce\x16\xdd\x63\x4e\x97\xd2\x7b\x1e\xe5\xa0\x8c\x37\xe5\x2f\xe2\x75\x17\x9f\x72\x86\xec\x7d\xd9\x57\xbf\xec\x49\x84\x7b\xba\x8e\x7e\x27\x32\x4f\x38\xde\xf0\xb8\x5f\x83\xd0\xc8\x6a\xf2\xf4\x8a\x3a\x8a\x73\x8a\xca\x16\x5f\xe9\x6e\x38\xbe\xc2\xaf\x4c\x0c\x0b\xf5\xd7\xae\xab\xe7\x6a\x6e\xaa\x0e\xb9\xde\x50\x1a\x7e\x16\x4d\xaf\xa6\x48\x48\x2d\xca\x67\x93\xf4\xdf\x37\xda\x1f\xc8\x56\xbe\x41\x62\xb6\xeb\xc0\x43\x94\x09\xad\x7c\x32\xd8\x37\x5f\xbf\x10\xb5\xfc\x7d\x8c\x24\xcd\x79\x75\xb7\x98\x59\x2d\xd3\x75\x21\xac\xdd\x7a\x21\x5b\xe0\xb9\x90\x9e\xe4\xfa\xcf\x7b\xe6\x4a\xa8\x65\x55\xf7\x1d\x98\xe4\x39\x70\x79\xa2\x0c\xca\x2c\xf9\x3b\x00\x00\xff\xff\x6c\x5b\xd5\x58\xe0\x09\x00\x00") func installerStashAppscodeCom_stashelasticsearchesV1YamlBytes() ([]byte, error) { return bindataRead( @@ -93,12 +93,12 @@ func installerStashAppscodeCom_stashelasticsearchesV1Yaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "installer.stash.appscode.com_stashelasticsearches.v1.yaml", size: 2415, mode: os.FileMode(420), modTime: time.Unix(1573722179, 0)} + info := bindataFileInfo{name: "installer.stash.appscode.com_stashelasticsearches.v1.yaml", size: 2528, mode: os.FileMode(420), modTime: time.Unix(1573722179, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _installerStashAppscodeCom_stashelasticsearchesYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\x6d\x8f\xdc\x34\x10\xfe\xbe\xbf\x62\x24\x90\x0a\x88\x64\x39\x55\x42\x90\x2f\x08\x1d\x45\xaa\x28\x2f\xea\x96\x7e\x39\x15\x69\xd6\x9e\xcd\x0e\xe7\xd8\xc6\x33\x09\xbd\xfb\xf5\xc8\x4e\xb2\xb7\xaf\x47\xaf\x02\x7f\x8a\x1f\xcf\x9b\x9f\x67\xc6\x0a\x46\x7e\x4b\x49\x38\xf8\x06\x30\x32\xbd\x57\xf2\x79\x27\xf5\xed\x37\x52\x73\x58\x0e\x57\x6b\x52\xbc\x5a\xdc\xb2\xb7\x0d\x5c\xf7\xa2\xa1\x7b\x4d\x12\xfa\x64\xe8\x07\xda\xb0\x67\xe5\xe0\x17\x1d\x29\x5a\x54\x6c\x16\x00\x26\x11\x66\xf0\x0d\x77\x24\x8a\x5d\x6c\xc0\xf7\xce\x2d\x00\x1c\xae\xc9\x49\xb6\x01\xc0\x18\x1b\x10\x45\xd9\x2e\x00\x3c\x76\x34\xed\xc8\xa1\x28\x1b\x21\x4c\x66\x4b\x52\xb3\x17\x45\xe7\x28\xd5\xe5\xb8\xc6\x18\xc5\x04\x4b\xb5\x09\xdd\x42\x22\x99\x1c\xae\x4d\xa1\x8f\x0d\x3c\x6a\x3b\x66\x99\xb2\x1b\x54\x6a\x43\xe2\x79\x5f\xed\x4a\xc9\xdf\xb3\x5f\xd9\x8e\x37\x5f\xe5\xe3\x17\xfb\xb5\x95\x43\xc7\xa2\x3f\x5d\x30\x78\xc5\xa2\xc5\x28\xba\x3e\xa1\x3b\x7f\xbf\x62\x20\xec\xdb\xde\x61\x3a\x67\xb2\x00\x88\x89\x84\xd2\x40\xbf\xfb\x5b\x1f\xfe\xf6\x3f\x32\x39\x2b\x0d\x6c\xd0\x49\x2e\x51\x4c\x88\xd4\xc0\x2f\xf9\x76\x11\x0d\xd9\x05\xc0\x80\x8e\x6d\x51\x61\xbc\x5f\x88\xe4\xbf\xff\xed\xe5\xdb\xe7\x2b\xb3\xa5\x0e\x47\x30\x47\x0e\x91\x92\xee\x68\x18\x85\xd9\xb5\xc4\x0e\x03\xb0\x24\x26\x71\x2c\x11\xe1\x59\x0e\x35\xda\x80\xcd\x4d\x40\x02\xba\x25\x18\x46\x8c\x2c\x48\x49\x03\x61\x03\xba\x65\x81\x44\xe5\x0e\x5e\x4b\x49\x7b\x61\x21\x9b\xa0\x87\xb0\xfe\x93\x8c\xd6\xb0\xca\xf7\x4c\x02\xb2\x0d\xbd\xb3\x60\x82\x1f\x28\x29\x24\x32\xa1\xf5\x7c\xbf\x8b\x2c\xa0\xa1\xa4\x74\xa8\x34\xd1\x3c\x2f\xf6\x4a\xc9\xa3\xcb\x24\xf4\xf4\x25\xa0\xb7\xd0\xe1\x1d\x24\xca\x39\xa0\xf7\x7b\xd1\x8a\x89\xd4\xf0\x73\x48\x04\xec\x37\xa1\x81\xad\x6a\x94\x66\xb9\x6c\x59\xe7\x21\x30\xa1\xeb\x7a\xcf\x7a\xb7\x34\xc1\x6b\xe2\x75\xaf\x21\xc9\xd2\xd2\x40\x6e\x29\xdc\x56\x59\x28\x56\x32\xda\x27\x5a\x62\xe4\xaa\x14\xee\xb5\x4c\x52\x67\x3f\x49\xd3\xc4\xc8\xb3\xbd\x4a\xf5\x2e\x96\xa6\x4f\xec\xdb\x1d\x5c\xba\xed\x22\xef\xb9\xd5\x80\x05\x70\x72\x1b\xeb\x7f\xa0\x37\x43\x99\x95\xd7\x2f\x56\x6f\x60\x4e\x5a\x24\x38\xe4\xbc\xb0\xfd\xe0\x26\x0f\xc4\x67\xa2\xd8\x6f\x28\x8d\xc2\x6d\x52\xe8\x4a\x44\xf2\x36\x06\xf6\x5a\x36\xc6\x31\xf9\x43\xd2\xa5\x5f\x77\xac\x59\xe9\xbf\x7a\x12\xcd\xfa\xd4\x70\x8d\xde\x07\x85\x35\x41\x1f\x2d\x2a\xd9\x1a\x5e\x7a\xb8\xc6\x8e\xdc\x35\x0a\xfd\xef\xb4\x67\x86\xa5\xca\x94\xfe\x3b\xf1\xfb\x2f\xd8\xbc\xce\x8d\x47\x5e\xe5\xb9\x3a\x40\x00\x3a\x7c\xff\x8a\x7c\xab\xdb\x06\xbe\x7e\x7e\x74\x16\x51\x73\x4b\x36\xf0\xc7\x0d\x56\xf7\xef\x3e\xbb\xa9\xb0\xba\xff\xaa\xfa\xf6\xdd\x17\x37\xd3\xc7\xe7\xdf\x7d\x7a\xe4\x73\xb6\xc8\x19\x1e\x05\xdc\xc1\xf3\x33\x78\xb6\x69\x4e\x1f\xa6\x55\x24\x93\xbb\x28\x4b\x39\x0d\xea\x26\xa4\xd1\x10\x4e\xdf\xb8\x79\x8d\xb3\x02\x1b\x76\xf4\x01\x1c\xad\xd1\xdc\xf6\xf1\x98\xa5\x4b\xd6\x79\x61\x6a\xcf\xa0\x17\x99\xb8\xc8\x46\x5e\x9b\xde\xb9\xac\xd2\xaf\x03\xa5\xc4\xf6\x44\xad\x8b\x31\xb9\xc3\xf6\xc4\xfa\xb1\xaa\x13\xb5\x2c\x9a\xee\x9e\x58\x79\x76\x8c\x41\x58\xc3\x47\xb8\x2a\xb6\x4f\xf4\xc9\x63\xc9\x89\xec\xb1\x5b\xb5\xab\xff\xcc\xc1\x5c\xdf\xc9\x91\xe2\x07\x0b\xf1\x51\x22\x24\x12\x0d\xe9\x49\x32\xfc\x77\xcd\x73\x8e\xaa\x6a\x6a\xe7\x03\xa8\xb4\xca\x01\x32\xd5\xfd\xf8\xb8\x1e\x41\xc3\xfc\xfb\x35\x5c\xa1\x8b\x5b\xbc\x7a\xc0\xca\x85\xaa\xe9\xe7\x68\xef\x18\xa0\xfc\x0e\xd8\x06\x34\xf5\x63\xb6\x9c\x37\x37\xee\x88\xfc\x13\x00\x00\xff\xff\x3c\x51\xbd\x9e\xd6\x09\x00\x00") +var _installerStashAppscodeCom_stashelasticsearchesYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x56\xdf\x8f\x1c\x35\x0c\x7e\xdf\xbf\xc2\x12\x48\x05\xc4\xec\x72\x2a\xaa\x60\x5e\x10\x3a\x8a\x54\x51\x7e\xa8\x57\xfa\x72\x2a\x92\x37\xe3\x9d\x35\x97\x49\x82\xed\xd9\xf6\xee\xaf\x47\xc9\xcc\xec\xed\xcf\xa3\x57\xd1\x3c\x4d\xbe\xd8\xce\x97\xcf\x76\x26\x98\xf8\x0d\x89\x72\x0c\x35\x60\x62\x7a\x6f\x14\xf2\x4c\xe7\x37\xdf\xe9\x9c\xe3\x62\x73\xb1\x24\xc3\x8b\xd9\x0d\x87\xa6\x86\xcb\x5e\x2d\x76\xaf\x48\x63\x2f\x8e\x7e\xa2\x15\x07\x36\x8e\x61\xd6\x91\x61\x83\x86\xf5\x0c\xc0\x09\x61\x06\x5f\x73\x47\x6a\xd8\xa5\x1a\x42\xef\xfd\x0c\xc0\xe3\x92\xbc\x66\x1b\x00\x4c\xa9\x06\x35\xd4\xf5\x0c\x20\x60\x47\xe3\x8c\x3c\xaa\xb1\x53\x42\x71\x6b\xd2\x39\x07\x35\xf4\x9e\x64\x5e\x96\xe7\x98\x92\xba\xd8\xd0\xdc\xc5\x6e\xa6\x89\x5c\x0e\xd7\x4a\xec\x53\x0d\x0f\xda\x0e\xbb\x8c\xbb\x3b\x34\x6a\xa3\xf0\x34\xaf\xb6\x54\xf2\xf7\xe4\x57\xa6\xc3\xc9\xaf\xf2\xf2\xf3\x5d\x6e\x65\xd1\xb3\xda\x2f\x67\x0c\x5e\xb2\x5a\x31\x4a\xbe\x17\xf4\xa7\xcf\x57\x0c\x94\x43\xdb\x7b\x94\x53\x26\x33\x80\x24\xa4\x24\x1b\xfa\x33\xdc\x84\xf8\x2e\xfc\xcc\xe4\x1b\xad\x61\x85\x5e\x33\x45\x75\x31\x51\x0d\xbf\xe5\xd3\x25\x74\xd4\xcc\x00\x36\xe8\xb9\x29\x59\x18\xce\x17\x13\x85\x1f\xff\x78\xf1\xe6\xe9\x95\x5b\x53\x87\x03\x98\x23\xc7\x44\x62\x5b\x19\x86\xc4\x6c\x4b\x62\x8b\x01\x34\xa4\x4e\x38\x95\x88\xf0\x24\x87\x1a\x6c\xa0\xc9\x45\x40\x0a\xb6\x26\xd8\x0c\x18\x35\xa0\x65\x1b\x88\x2b\xb0\x35\x2b\x08\x95\x33\x04\x2b\x94\x76\xc2\x42\x36\xc1\x00\x71\xf9\x37\x39\x9b\xc3\x55\x3e\xa7\x28\xe8\x3a\xf6\xbe\x01\x17\xc3\x86\xc4\x40\xc8\xc5\x36\xf0\xdd\x36\xb2\x82\xc5\xb2\xa5\x47\xa3\x51\xe6\x69\x70\x30\x92\x80\x3e\x8b\xd0\xd3\xd7\x80\xa1\x81\x0e\x6f\x41\x28\xef\x01\x7d\xd8\x89\x56\x4c\x74\x0e\xbf\x46\x21\xe0\xb0\x8a\x35\xac\xcd\x92\xd6\x8b\x45\xcb\x36\x35\x81\x8b\x5d\xd7\x07\xb6\xdb\x85\x8b\xc1\x84\x97\xbd\x45\xd1\x45\x43\x1b\xf2\x0b\xe5\xb6\xca\x89\x62\x23\x67\xbd\xd0\x02\x13\x57\x85\x78\xb0\xd2\x49\x5d\xf3\x99\x8c\x1d\xa3\x4f\x76\x98\xda\x6d\x2a\x45\x2f\x1c\xda\x2d\x5c\xaa\xed\xac\xee\xb9\xd4\x80\x15\x70\x74\x1b\xf8\xdf\xcb\x9b\xa1\xac\xca\xab\xe7\x57\xaf\x61\xda\xb4\xa4\x60\x5f\xf3\xa2\xf6\xbd\x9b\xde\x0b\x9f\x85\xe2\xb0\x22\x19\x12\xb7\x92\xd8\x95\x88\x14\x9a\x14\x39\x58\x99\x38\xcf\x14\xf6\x45\xd7\x7e\xd9\xb1\xe5\x4c\xff\xd3\x93\x5a\xce\xcf\x1c\x2e\x31\x84\x68\xb0\x24\xe8\x53\x83\x46\xcd\x1c\x5e\x04\xb8\xc4\x8e\xfc\x25\x2a\x7d\x72\xd9\xb3\xc2\x5a\x65\x49\xff\x5b\xf8\xdd\x1b\x6c\x1a\xa7\xda\x23\x8f\x72\x5d\xed\x21\x00\x1d\xbe\x7f\x49\xa1\xb5\x75\x0d\xcf\x9e\x1e\xac\x25\xb4\x5c\x92\x35\xfc\x75\x8d\xd5\xdd\xdb\x2f\xae\x2b\xac\xee\xbe\xa9\xbe\x7f\xfb\xd5\xf5\xf8\xf1\xe5\x0f\x9f\x1f\xf8\x9c\x24\x39\xc1\x43\x02\xb7\xf0\x74\x0d\x9e\x2c\x9a\xe3\x8b\xe9\x2a\x91\xcb\x55\x94\x53\x39\x36\xea\x2a\xca\x60\x08\xc7\x77\xdc\x34\x86\x5e\x81\x15\x7b\xfa\x00\x8d\x96\xe8\x6e\xfa\x74\xa8\xd2\x39\xeb\x3c\x50\xda\x13\xe8\x59\x25\xce\xaa\x91\xc7\xaa\xf7\x3e\x67\xe9\xf7\x0d\x89\x70\x73\x94\xad\xb3\x31\xb9\xc3\xf6\xc8\xfa\x21\xd6\x42\x2d\xab\xc9\xed\x23\x99\x67\xc7\x14\x95\x2d\x7e\x84\xab\x61\xfb\x48\x9f\xdc\x96\x2c\xd4\x1c\xba\x55\x5b\xfe\x27\x16\x26\x7e\x47\x4b\x86\x1f\x9c\x88\x8f\x4a\x82\x90\x5a\x94\x47\xa5\xe1\xff\x2c\x9e\x77\xc8\x96\x1f\x2f\xb1\xb7\xc3\x90\xab\x28\x1d\x5a\x7e\x69\xd8\xb3\x6f\x4f\xc6\xcb\x7f\x9f\x96\x64\xb6\x7b\x9a\x63\xed\xab\xb1\x3f\xf6\xa0\x52\x7b\x7b\xc8\x28\xc4\x1e\xb6\xc3\xee\xe1\x7b\xe1\x00\xda\x4c\xef\xbc\xcd\x05\xfa\xb4\xc6\x8b\x7b\xac\x28\x57\x8d\xaf\xb0\x9d\x65\x80\xf2\xee\x68\x6a\x30\xe9\x07\x16\x99\x4f\xee\x90\x01\xf9\x37\x00\x00\xff\xff\x06\x16\x4d\x45\x3f\x0a\x00\x00") func installerStashAppscodeCom_stashelasticsearchesYamlBytes() ([]byte, error) { return bindataRead( @@ -113,7 +113,7 @@ func installerStashAppscodeCom_stashelasticsearchesYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "installer.stash.appscode.com_stashelasticsearches.yaml", size: 2518, mode: os.FileMode(420), modTime: time.Unix(1573722179, 0)} + info := bindataFileInfo{name: "installer.stash.appscode.com_stashelasticsearches.yaml", size: 2623, mode: os.FileMode(420), modTime: time.Unix(1573722179, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -215,8 +215,8 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "installer.stash.appscode.com_stashelasticsearches.v1.yaml": &bintree{installerStashAppscodeCom_stashelasticsearchesV1Yaml, map[string]*bintree{}}, - "installer.stash.appscode.com_stashelasticsearches.yaml": &bintree{installerStashAppscodeCom_stashelasticsearchesYaml, map[string]*bintree{}}, + "installer.stash.appscode.com_stashelasticsearches.v1.yaml": {installerStashAppscodeCom_stashelasticsearchesV1Yaml, map[string]*bintree{}}, + "installer.stash.appscode.com_stashelasticsearches.yaml": {installerStashAppscodeCom_stashelasticsearchesYaml, map[string]*bintree{}}, }} // RestoreAsset restores an asset under the given directory diff --git a/api/crds/installer.stash.appscode.com_stashelasticsearches.v1.yaml b/api/crds/installer.stash.appscode.com_stashelasticsearches.v1.yaml index e847e7bec..d826e4670 100644 --- a/api/crds/installer.stash.appscode.com_stashelasticsearches.v1.yaml +++ b/api/crds/installer.stash.appscode.com_stashelasticsearches.v1.yaml @@ -64,10 +64,14 @@ spec: args: type: string type: object + waitTimeout: + format: int64 + type: integer required: - backup - image - restore + - waitTimeout type: object type: object served: true diff --git a/api/crds/installer.stash.appscode.com_stashelasticsearches.yaml b/api/crds/installer.stash.appscode.com_stashelasticsearches.yaml index b036c43c0..e2dd1806b 100644 --- a/api/crds/installer.stash.appscode.com_stashelasticsearches.yaml +++ b/api/crds/installer.stash.appscode.com_stashelasticsearches.yaml @@ -68,10 +68,14 @@ spec: args: type: string type: object + waitTimeout: + format: int64 + type: integer required: - backup - image - restore + - waitTimeout type: object type: object version: v1alpha1 diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index aa8a7cd7a..a67a22ef9 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -964,7 +964,8 @@ "required": [ "image", "backup", - "restore" + "restore", + "waitTimeout" ], "properties": { "backup": { @@ -981,6 +982,10 @@ }, "restore": { "$ref": "#/definitions/dev.appscode.stash.elasticsearch.apis.installer.v1alpha1.ElasticsearchRestore" + }, + "waitTimeout": { + "type": "integer", + "format": "int64" } } }, diff --git a/apis/installer/v1alpha1/generated.pb.go b/apis/installer/v1alpha1/generated.pb.go index c08885449..ff7735004 100644 --- a/apis/installer/v1alpha1/generated.pb.go +++ b/apis/installer/v1alpha1/generated.pb.go @@ -21,15 +21,13 @@ package v1alpha1 import ( fmt "fmt" - io "io" - - proto "github.com/gogo/protobuf/proto" - math "math" math_bits "math/bits" reflect "reflect" strings "strings" + + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. @@ -225,47 +223,49 @@ func init() { } var fileDescriptor_24e00755a10e4272 = []byte{ - // 636 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0xd6, 0x76, 0x2b, 0xee, 0x80, 0xc9, 0x4c, 0x28, 0x9a, 0x44, 0x36, 0xf5, 0xb4, 0x03, - 0x38, 0xac, 0x42, 0xd0, 0x2b, 0x11, 0x20, 0x26, 0xed, 0x07, 0xf2, 0x38, 0x21, 0x0e, 0xb8, 0xe9, - 0x9b, 0x6b, 0xda, 0x34, 0xc1, 0x76, 0x2b, 0xf5, 0xc6, 0x9d, 0x0b, 0x7f, 0xd6, 0x8e, 0x3b, 0xee, - 0x34, 0xb1, 0x72, 0x82, 0x2b, 0xff, 0x00, 0x8a, 0xe3, 0x76, 0xe9, 0x32, 0xc4, 0x54, 0xed, 0x16, - 0xbf, 0xf7, 0xbe, 0xef, 0x7b, 0xdf, 0xcb, 0xb3, 0xd1, 0x5b, 0xa5, 0x99, 0xea, 0x12, 0x96, 0x24, - 0x2a, 0x8c, 0x3b, 0x40, 0x3a, 0x30, 0xf2, 0xa1, 0xcf, 0x94, 0x16, 0xa1, 0x02, 0x26, 0xc3, 0xae, - 0xcf, 0x12, 0xa1, 0x7c, 0x31, 0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 0x15, 0xb8, 0x89, 0x90, 0x84, - 0x24, 0x56, 0x42, 0xc7, 0x72, 0xec, 0x2e, 0x99, 0x7a, 0x6c, 0xeb, 0x11, 0x9d, 0x65, 0x68, 0xae, - 0x0a, 0x3f, 0x42, 0x65, 0xcd, 0xb8, 0x5b, 0x36, 0xc5, 0x75, 0x5b, 0x5c, 0x7e, 0xcf, 0x38, 0x4d, - 0xe3, 0x8d, 0xdf, 0x0e, 0xc2, 0x47, 0xe9, 0x2e, 0xcc, 0xb9, 0xc1, 0x9f, 0x50, 0x2d, 0xfd, 0x37, - 0x1d, 0xa6, 0x99, 0xe9, 0xab, 0xde, 0x7c, 0x4a, 0xb2, 0x11, 0x93, 0xfc, 0x88, 0x49, 0xd2, 0xe3, - 0xd9, 0xa6, 0xa4, 0xd5, 0x64, 0xb4, 0x43, 0x0e, 0xdb, 0x9f, 0x21, 0xd4, 0xfb, 0xa0, 0xd9, 0x65, - 0x67, 0x97, 0x31, 0x3a, 0x63, 0xc5, 0x12, 0x55, 0x54, 0x02, 0xa1, 0x71, 0x51, 0x6f, 0xbe, 0x23, - 0x8b, 0x2e, 0x24, 0x29, 0x76, 0x7f, 0x94, 0x40, 0x78, 0x39, 0xfa, 0xf4, 0x44, 0x8d, 0x56, 0xe3, - 0x97, 0x83, 0x1e, 0x16, 0xcb, 0xf7, 0x84, 0xd2, 0xf8, 0x63, 0xc1, 0x30, 0xb9, 0x99, 0xe1, 0x14, - 0x6d, 0xec, 0xce, 0x7e, 0xdc, 0x34, 0x92, 0x33, 0xfb, 0x05, 0x55, 0x85, 0x86, 0x48, 0xb9, 0x4b, - 0x5b, 0xe5, 0xed, 0x7a, 0x73, 0xef, 0x36, 0xdd, 0x06, 0x77, 0xad, 0x70, 0x75, 0x37, 0x95, 0xa0, - 0x99, 0x52, 0xe3, 0x4f, 0xf9, 0x3a, 0xaf, 0xe9, 0x30, 0x70, 0x0b, 0xad, 0x0e, 0x58, 0x04, 0x87, - 0x23, 0x90, 0x52, 0x74, 0xc0, 0x2e, 0xde, 0xba, 0xa5, 0x59, 0x3d, 0xc8, 0xe5, 0xe8, 0x5c, 0x25, - 0x7e, 0x85, 0xd6, 0x8e, 0x87, 0xfd, 0xfe, 0x1c, 0x3a, 0x5b, 0x43, 0xd7, 0xa2, 0xd7, 0xde, 0x5c, - 0xc9, 0xd3, 0x02, 0x02, 0x73, 0x54, 0x15, 0xe9, 0x05, 0x30, 0x4b, 0x59, 0x6f, 0x06, 0x8b, 0x4f, - 0x63, 0x7a, 0x8f, 0x72, 0x33, 0x30, 0x91, 0x8c, 0x1f, 0x0f, 0xd1, 0x72, 0xdb, 0x5c, 0x68, 0xb7, - 0x62, 0x94, 0xf6, 0x17, 0x57, 0xba, 0xe6, 0x95, 0x08, 0xee, 0x59, 0xd1, 0xe5, 0xec, 0x4c, 0xad, - 0x18, 0x1e, 0xa3, 0x15, 0x99, 0x3d, 0x07, 0x6e, 0xd5, 0xe8, 0x1e, 0xdc, 0x92, 0xae, 0x7d, 0x64, - 0x82, 0xfb, 0x56, 0x78, 0xc5, 0x06, 0xe8, 0x54, 0x2f, 0x20, 0x27, 0x17, 0x5e, 0xe9, 0xf4, 0xc2, - 0x2b, 0x9d, 0x5d, 0x78, 0xa5, 0xaf, 0x13, 0xcf, 0x39, 0x99, 0x78, 0xce, 0xe9, 0xc4, 0x73, 0xce, - 0x26, 0x9e, 0xf3, 0x63, 0xe2, 0x39, 0xdf, 0x7f, 0x7a, 0xa5, 0x0f, 0xb5, 0x29, 0xfd, 0xdf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x62, 0x97, 0xcd, 0x56, 0x52, 0x06, 0x00, 0x00, + // 668 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4d, 0x6f, 0xd3, 0x4a, + 0x14, 0x8d, 0x9b, 0xa4, 0xcd, 0x9b, 0xf4, 0xbd, 0x57, 0x4d, 0xab, 0x27, 0xab, 0xd2, 0x73, 0xa3, + 0xac, 0xba, 0x80, 0x31, 0x8d, 0xf8, 0xc8, 0x16, 0x0b, 0x10, 0x95, 0xfa, 0x81, 0xa6, 0x95, 0x90, + 0x10, 0x0b, 0x26, 0xce, 0xad, 0x33, 0x24, 0x8e, 0xcd, 0xcc, 0x38, 0x28, 0x3b, 0xf6, 0x6c, 0xf8, + 0x1d, 0xfc, 0x92, 0x2e, 0xbb, 0xec, 0xaa, 0xa2, 0x61, 0x05, 0xbf, 0x02, 0x79, 0x3c, 0x49, 0x9c, + 0xba, 0x88, 0xaa, 0xea, 0xce, 0x73, 0xef, 0x39, 0xf7, 0xdc, 0x73, 0x7d, 0x67, 0xd0, 0x4b, 0xa9, + 0x98, 0xec, 0x11, 0x16, 0xc7, 0xd2, 0x8f, 0xba, 0x40, 0xba, 0x30, 0x72, 0x61, 0xc0, 0xa4, 0xe2, + 0xbe, 0x04, 0x26, 0xfc, 0x9e, 0xcb, 0x62, 0x2e, 0x5d, 0x3e, 0x94, 0x8a, 0x0d, 0x06, 0x20, 0xdc, + 0xd1, 0x0e, 0x1b, 0xc4, 0x3d, 0xb6, 0xe3, 0x06, 0x30, 0x04, 0xc1, 0x14, 0x74, 0x49, 0x2c, 0x22, + 0x15, 0xe1, 0x76, 0xb1, 0x12, 0x59, 0xa8, 0x44, 0xd2, 0x4a, 0x64, 0x56, 0x89, 0x4c, 0x2b, 0x6d, + 0xde, 0x0f, 0xb8, 0xea, 0x25, 0x1d, 0xe2, 0x47, 0xa1, 0x1b, 0x44, 0x41, 0xe4, 0xea, 0x82, 0x9d, + 0xe4, 0x44, 0x9f, 0xf4, 0x41, 0x7f, 0x65, 0x42, 0x9b, 0x0f, 0xfb, 0x6d, 0x49, 0x78, 0x94, 0x36, + 0x16, 0x32, 0xbf, 0xc7, 0x87, 0x20, 0xc6, 0x6e, 0xdc, 0x0f, 0xb2, 0x4e, 0x43, 0x50, 0xcc, 0x1d, + 0x15, 0xda, 0xdb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 0xee, 0x48, 0xd7, 0x3c, 0x32, 0xde, 0xbf, 0x46, 0x78, 0xc5, 0x04, 0xe8, 0x54, 0x0f, 0x3f, + 0x42, 0xf5, 0x8f, 0x8c, 0xab, 0x63, 0x1e, 0x42, 0x94, 0x28, 0x7b, 0xb9, 0x61, 0x6d, 0x97, 0xbd, + 0x75, 0x03, 0xaf, 0xbf, 0x9e, 0xa7, 0x68, 0x1e, 0xe7, 0x91, 0xd3, 0x4b, 0xa7, 0x74, 0x76, 0xe9, + 0x94, 0xce, 0x2f, 0x9d, 0xd2, 0xa7, 0x89, 0x63, 0x9d, 0x4e, 0x1c, 0xeb, 0x6c, 0xe2, 0x58, 0xe7, + 0x13, 0xc7, 0xfa, 0x36, 0x71, 0xac, 0x2f, 0xdf, 0x9d, 0xd2, 0x9b, 0xda, 0xb4, 0xab, 0x5f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xd0, 0xc3, 0xd6, 0x12, 0x89, 0x06, 0x00, 0x00, } func (m *ElasticsearchBackup) Marshal() (dAtA []byte, err error) { @@ -472,6 +472,9 @@ func (m *StashElasticsearchSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.WaitTimeout)) + i-- + dAtA[i] = 0x30 { size, err := m.Restore.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -609,6 +612,7 @@ func (m *StashElasticsearchSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Restore.Size() n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.WaitTimeout)) return n } @@ -687,6 +691,7 @@ func (this *StashElasticsearchSpec) String() string { `Image:` + strings.Replace(strings.Replace(this.Image.String(), "ImageRef", "ImageRef", 1), `&`, ``, 1) + `,`, `Backup:` + strings.Replace(strings.Replace(this.Backup.String(), "ElasticsearchBackup", "ElasticsearchBackup", 1), `&`, ``, 1) + `,`, `Restore:` + strings.Replace(strings.Replace(this.Restore.String(), "ElasticsearchRestore", "ElasticsearchRestore", 1), `&`, ``, 1) + `,`, + `WaitTimeout:` + fmt.Sprintf("%v", this.WaitTimeout) + `,`, `}`, }, "") return s @@ -1449,6 +1454,25 @@ func (m *StashElasticsearchSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WaitTimeout", wireType) + } + m.WaitTimeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WaitTimeout |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/apis/installer/v1alpha1/generated.proto b/apis/installer/v1alpha1/generated.proto index f657fdb95..454f62979 100644 --- a/apis/installer/v1alpha1/generated.proto +++ b/apis/installer/v1alpha1/generated.proto @@ -75,5 +75,7 @@ message StashElasticsearchSpec { optional ElasticsearchBackup backup = 4; optional ElasticsearchRestore restore = 5; + + optional int64 waitTimeout = 6; } diff --git a/apis/installer/v1alpha1/openapi_generated.go b/apis/installer/v1alpha1/openapi_generated.go index 14e53f180..c6f5010a3 100644 --- a/apis/installer/v1alpha1/openapi_generated.go +++ b/apis/installer/v1alpha1/openapi_generated.go @@ -15709,8 +15709,14 @@ func schema_elasticsearch_apis_installer_v1alpha1_StashElasticsearchSpec(ref com Ref: ref("stash.appscode.dev/elasticsearch/apis/installer/v1alpha1.ElasticsearchRestore"), }, }, + "waitTimeout": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, }, - Required: []string{"image", "backup", "restore"}, + Required: []string{"image", "backup", "restore", "waitTimeout"}, }, }, Dependencies: []string{ diff --git a/apis/installer/v1alpha1/stash_elasticsearch_types.go b/apis/installer/v1alpha1/stash_elasticsearch_types.go index b6ee61e02..f176a3c6d 100644 --- a/apis/installer/v1alpha1/stash_elasticsearch_types.go +++ b/apis/installer/v1alpha1/stash_elasticsearch_types.go @@ -50,6 +50,7 @@ type StashElasticsearchSpec struct { Image ImageRef `json:"image" protobuf:"bytes,3,opt,name=image"` Backup ElasticsearchBackup `json:"backup" protobuf:"bytes,4,opt,name=backup"` Restore ElasticsearchRestore `json:"restore" protobuf:"bytes,5,opt,name=restore"` + WaitTimeout int64 `json:"waitTimeout" protobuf:"varint,6,opt,name=waitTimeout"` } type ImageRef struct { diff --git a/charts/stash-elasticsearch/README.md b/charts/stash-elasticsearch/README.md index 277abf58d..3b5cda6d5 100644 --- a/charts/stash-elasticsearch/README.md +++ b/charts/stash-elasticsearch/README.md @@ -53,6 +53,7 @@ The following table lists the configurable parameters of the `stash-elasticsearc | image.tag | Tag of the image that is used to backup/restore Elasticsearch database. This is usually same as the database version it can backup. | `"6.4.0"` | | backup.args | Arguments to pass to `multielasticdump` command during backup process | `""` | | restore.args | Arguments to pass to `multielasticdump` command during restore process | `""` | +| waitTimeout | Number of seconds to wait for the database to be ready before backup/restore process. | `300` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: diff --git a/charts/stash-elasticsearch/templates/elasticsearch-backup-function.yaml b/charts/stash-elasticsearch/templates/elasticsearch-backup-function.yaml index 0d98a092f..1eb745caf 100644 --- a/charts/stash-elasticsearch/templates/elasticsearch-backup-function.yaml +++ b/charts/stash-elasticsearch/templates/elasticsearch-backup-function.yaml @@ -18,6 +18,7 @@ spec: - --scratch-dir=/tmp - --enable-cache=${ENABLE_CACHE:=true} - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit + - --wait-timeout=${waitTimeout:={{ .Values.waitTimeout}}} - --hostname=${HOSTNAME:=} - --interim-data-dir=${INTERIM_DATA_DIR} # target information diff --git a/charts/stash-elasticsearch/templates/elasticsearch-restore-function.yaml b/charts/stash-elasticsearch/templates/elasticsearch-restore-function.yaml index 854d70062..28dce98fe 100644 --- a/charts/stash-elasticsearch/templates/elasticsearch-restore-function.yaml +++ b/charts/stash-elasticsearch/templates/elasticsearch-restore-function.yaml @@ -18,6 +18,7 @@ spec: - --scratch-dir=/tmp - --enable-cache=${ENABLE_CACHE:=true} - --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit + - --wait-timeout=${waitTimeout:={{ .Values.waitTimeout}}} - --hostname=${HOSTNAME:=} - --source-hostname=${SOURCE_HOSTNAME:=} - --interim-data-dir=${INTERIM_DATA_DIR} diff --git a/charts/stash-elasticsearch/values.openapiv3_schema.yaml b/charts/stash-elasticsearch/values.openapiv3_schema.yaml index 559aad81f..767d3e912 100644 --- a/charts/stash-elasticsearch/values.openapiv3_schema.yaml +++ b/charts/stash-elasticsearch/values.openapiv3_schema.yaml @@ -26,8 +26,12 @@ properties: args: type: string type: object + waitTimeout: + format: int64 + type: integer required: - backup - image - restore +- waitTimeout type: object diff --git a/charts/stash-elasticsearch/values.yaml b/charts/stash-elasticsearch/values.yaml index b9f685e7e..934798ed0 100644 --- a/charts/stash-elasticsearch/values.yaml +++ b/charts/stash-elasticsearch/values.yaml @@ -23,3 +23,6 @@ backup: restore: # Arguments to pass to `multielasticdump` command during restore process args: "" + +# Number of seconds to wait for the database to be ready before backup/restore process. +waitTimeout: 300 diff --git a/pkg/backup.go b/pkg/backup.go index 08965af76..d2892aa6f 100644 --- a/pkg/backup.go +++ b/pkg/backup.go @@ -44,6 +44,7 @@ func NewCmdBackup() *cobra.Command { masterURL string kubeconfigPath string opt = esOptions{ + waitTimeout: 300, setupOptions: restic.SetupOptions{ ScratchDir: restic.DefaultScratchDir, EnableCache: false, @@ -98,6 +99,7 @@ func NewCmdBackup() *cobra.Command { } cmd.Flags().StringVar(&opt.esArgs, "es-args", opt.esArgs, "Additional arguments") + cmd.Flags().Int32Var(&opt.waitTimeout, "wait-timeout", opt.waitTimeout, "Number of seconds to wait for the database to be ready") cmd.Flags().StringVar(&masterURL, "master", masterURL, "The address of the Kubernetes API server (overrides any value in kubeconfig)") cmd.Flags().StringVar(&kubeconfigPath, "kubeconfig", kubeconfigPath, "Path to kubeconfig file with authorization information (the master location is set by the master flag).") @@ -173,7 +175,7 @@ func (opt *esOptions) backupElasticsearch() (*restic.BackupOutput, error) { esURL := fmt.Sprintf("%v://%s:%s@%s:%d", appSVC.Scheme, appBindingSecret.Data[ESUser], appBindingSecret.Data[ESPassword], appSVC.Name, appSVC.Port) // TODO: authplugin: none // wait for DB ready - waitForDBReady(appBinding.Spec.ClientConfig.Service.Name, appBinding.Spec.ClientConfig.Service.Port) + waitForDBReady(appBinding.Spec.ClientConfig.Service.Name, appBinding.Spec.ClientConfig.Service.Port, opt.waitTimeout) // run separate shell to dump indices log.Infoln("Performing multielasticdump on ", appSVC.Name) diff --git a/pkg/restore.go b/pkg/restore.go index 7a8b2c5c3..ac81a755b 100644 --- a/pkg/restore.go +++ b/pkg/restore.go @@ -43,6 +43,7 @@ func NewCmdRestore() *cobra.Command { masterURL string kubeconfigPath string opt = esOptions{ + waitTimeout: 300, setupOptions: restic.SetupOptions{ ScratchDir: restic.DefaultScratchDir, EnableCache: false, @@ -96,6 +97,7 @@ func NewCmdRestore() *cobra.Command { } cmd.Flags().StringVar(&opt.esArgs, "es-args", opt.esArgs, "Additional arguments") + cmd.Flags().Int32Var(&opt.waitTimeout, "wait-timeout", opt.waitTimeout, "Number of seconds to wait for the database to be ready") cmd.Flags().StringVar(&masterURL, "master", masterURL, "The address of the Kubernetes API server (overrides any value in kubeconfig)") cmd.Flags().StringVar(&kubeconfigPath, "kubeconfig", kubeconfigPath, "Path to kubeconfig file with authorization information (the master location is set by the master flag).") @@ -162,6 +164,9 @@ func (opt *esOptions) restoreElasticsearch() (*restic.RestoreOutput, error) { appSVC := appBinding.Spec.ClientConfig.Service esURL := fmt.Sprintf("%v://%s:%s@%s:%d", appSVC.Scheme, appBindingSecret.Data[ESUser], appBindingSecret.Data[ESPassword], appSVC.Name, appSVC.Port) // TODO: support for authplugin: none + // wait for DB ready + waitForDBReady(appBinding.Spec.ClientConfig.Service.Name, appBinding.Spec.ClientConfig.Service.Port, opt.waitTimeout) + // we will restore the desired data into interim data dir before injecting into the desired database opt.restoreOptions.RestorePaths = []string{opt.interimDataDir} diff --git a/pkg/utils.go b/pkg/utils.go index 9f0d3b33d..0cdc8057e 100644 --- a/pkg/utils.go +++ b/pkg/utils.go @@ -45,15 +45,16 @@ type esOptions struct { esArgs string interimDataDir string outputDir string + waitTimeout int32 setupOptions restic.SetupOptions backupOptions restic.BackupOptions restoreOptions restic.RestoreOptions } -func waitForDBReady(host string, port int32) { +func waitForDBReady(host string, port, waitTimeout int32) { log.Infoln("Checking database connection") - cmd := fmt.Sprintf(`nc "%s" "%d" -w 30`, host, port) + cmd := fmt.Sprintf(`nc "%s" "%d" -w %d`, host, port, waitTimeout) for { if err := exec.Command(cmd).Run(); err != nil { break