Skip to content

Commit

Permalink
Merge master to stable branch (#572)
Browse files Browse the repository at this point in the history
* 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
caoyingjunz and lbemi authored Jan 18, 2025
1 parent 2881f47 commit afc06a2
Show file tree
Hide file tree
Showing 34 changed files with 2,541 additions and 516 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-webshell-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- "master"
paths:
- 'docker/Dockerfile'
- 'docker/Dockerfile-toolbox'
- 'Makefile'

env:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
file: ./docker/Dockerfile-toolbox
platforms: linux/amd64,linux/arm64
build-args: |
K8S_VERSION=${{ env.K8S_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ env.COMMIT_HASH }}-${{ env.TIMESTAMP }}
Expand Down
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions api/server/router/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,4 @@ func (cr *clusterRouter) initRoutes(httpEngine *gin.Engine) {
indexerRoute.GET("/clusters/:cluster/resources/:resource/namespaces/:namespace", cr.listIndexerResources)
}

// 调用 helm 对象
helmRoute := httpEngine.Group(helmBaseURL)
{
// 获取 release 列表
helmRoute.GET("/clusters/:cluster/v1/namespaces/:namespace/releases", cr.ListReleases)
}
}
42 changes: 0 additions & 42 deletions api/server/router/cluster/helm_routes.go

This file was deleted.

66 changes: 66 additions & 0 deletions api/server/router/helm/helm.go
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)
}
}
Loading

0 comments on commit afc06a2

Please sign in to comment.