Files
kubevela/pkg/apiserver/rest/utils/bcode/addon.go
Hongchao Deng 3ebc94394c Feat: addon service impl (#2515)
* Feat: addon service impl

* get addon from git/configmap

* add ListAddonRegistries

* add GetAddonModel

* add CreateAddonRegistry and bcode/addon.go

* add applyAddonData

* update

* Fix: getAddonFromGit

* Fix: getAddonFromGit, remove trailing .git

* add comment

* add enable/disable/status impl

* add deleteAddonRegistry and check dup addon

* read addon without accessing database

* change to query parameter, add addon detail

* Feat: add addon readme for apiserver

* Make enable/disable/status runnable

* chore: fix bcode

* Fix: refactor parse to util

* Fix: refactor addonutil to pkg

* add addon test for create and delete addon registry

* fix version prefix

* add post func

* add enable/disable test

* add provider aws readme

* done testing

* fix comment and refactor statusAddon

* move enable/disable logic to usecase

* add GITHUB_TOKEN env

* Fix: Add github token support and use it in test

* add license

Co-authored-by: qiaozp <chivalry.pp@gmail.com>
2021-10-26 17:52:34 +08:00

48 lines
1.7 KiB
Go

/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT 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 bcode
var (
// ErrAddonNotExist addon not exist
ErrAddonNotExist = NewBcode(400, 50001, "addon not exist")
// ErrAddonRegistryExist application is exist
ErrAddonRegistryExist = NewBcode(400, 50002, "addon name already exists")
// ErrAddonRenderFail fail to render addon application
ErrAddonRenderFail = NewBcode(500, 50010, "addon render fail")
// ErrAddonApplyFail fail to apply application to cluster
ErrAddonApplyFail = NewBcode(500, 50011, "fail to apply addon application")
// ErrGetClientFail fail to get k8s client
ErrGetClientFail = NewBcode(500, 50012, "fail to initialize kubernetes client")
// ErrGetApplicationFail fail to get addon application
ErrGetApplicationFail = NewBcode(500, 50013, "fail to get addon application")
// ErrGetConfigMapAddonFail fail to get addon info in configmap
ErrGetConfigMapAddonFail = NewBcode(500, 50014, "fail to get addon information in ConfigMap")
// ErrAddonDisableFail fail to disable addon
ErrAddonDisableFail = NewBcode(500, 50016, "fail to disable addon")
// ErrAddonNotEnabled means addon can't be disable because it's not enabled
ErrAddonNotEnabled = NewBcode(400, 50017, "addon not enabled")
)