-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master to stable branch (#572)
* Bump go version to 1.17 (#557) * Add tls completed (#560) * 支持Helm release 的查询和删除API (#554) Co-authored-by: caoyingjunz <[email protected]> * 调整helm路由结构 (#564) Co-authored-by: caoyingjunz <[email protected]> * 优化pixiu容器启动进程 (#569) * 支持前后端代码合并 (#561) * Add +x for start.sh (#570) * 简化镜像启动依赖配置 (#571) --------- Co-authored-by: lei <[email protected]>
- Loading branch information
1 parent
2881f47
commit afc06a2
Showing
34 changed files
with
2,541 additions
and
516 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
Copyright 2021 The Pixiu Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT 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 helm | ||
|
||
import ( | ||
"github.com/gin-gonic/gin" | ||
|
||
"github.com/caoyingjunz/pixiu/cmd/app/options" | ||
"github.com/caoyingjunz/pixiu/pkg/controller" | ||
) | ||
|
||
const ( | ||
helmBaseURL = "/pixiu/helms" | ||
) | ||
|
||
type helmRouter struct { | ||
c controller.PixiuInterface | ||
} | ||
|
||
func NewRouter(o *options.Options) { | ||
hr := &helmRouter{ | ||
c: o.Controller, | ||
} | ||
hr.initRoutes(o.HttpEngine) | ||
} | ||
|
||
func (hr *helmRouter) initRoutes(httpEngine *gin.Engine) { | ||
|
||
helmRoute := httpEngine.Group(helmBaseURL) | ||
{ | ||
// helm Repository | ||
helmRoute.POST("/repositories", hr.createRepository) | ||
helmRoute.PUT("/repositories/:id", hr.updateRepository) | ||
helmRoute.DELETE("/repositories/:id", hr.deleteRepository) | ||
helmRoute.GET("/repositories/:id", hr.getRepository) | ||
helmRoute.GET("/repositories", hr.listRepositories) | ||
|
||
helmRoute.GET("/repositories/:id/charts", hr.getRepoCharts) | ||
helmRoute.GET("/repositories/charts", hr.getRepoChartsByURL) | ||
helmRoute.GET("/repositories/values", hr.getChartValues) | ||
|
||
// Helm Release | ||
helmRoute.POST("/clusters/:cluster/namespaces/:namespace/releases", hr.InstallRelease) | ||
helmRoute.PUT("/clusters/:cluster/namespaces/:namespace/releases", hr.UpgradeRelease) | ||
helmRoute.DELETE("/clusters/:cluster/namespaces/:namespace/releases/:name", hr.UninstallRelease) | ||
helmRoute.GET("/clusters/:cluster/namespaces/:namespace/releases/:name", hr.GetRelease) | ||
helmRoute.GET("/clusters/:cluster/namespaces/:namespace/releases", hr.ListReleases) | ||
|
||
helmRoute.GET("/clusters/:cluster/namespaces/:namespace/releases/:name/history", hr.GetReleaseHistory) | ||
helmRoute.POST("/clusters/:cluster/namespaces/:namespace/releases/:name/rollback", hr.RollbackRelease) | ||
} | ||
} |
Oops, something went wrong.