Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions[bot]
a3ee8eb01d [Backport release-1.5] Fix: remove the cloudshell dockerfile (#4549)
* Fix: remove the cloudshell dockerfile

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 7839e130b8)

* Fix: change the configmap name

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit f4e390e5c4)

* Fix: change the way to get the namespace

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
(cherry picked from commit 20ce558efe)

Co-authored-by: barnettZQG <barnett.zqg@gmail.com>
2022-08-03 16:20:34 +08:00
github-actions[bot]
84b4d0f685 [Backport release-1.5] Feat: report the manifest name when addon enabling failed (#4547)
* Feat: Report the manifest name when Addon enabling failed

Signed-off-by: ghostloda <78798447@qq.com>
(cherry picked from commit d143c341af)

* Apply suggestions from code review

Co-authored-by: Jianbo Sun <wonderflow@icloud.com>
Signed-off-by: ghostloda <78798447@qq.com>
(cherry picked from commit a5ba4658a9)

* Apply suggestions from code review

Co-authored-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: ghostloda <78798447@qq.com>
(cherry picked from commit 67f34ac4a6)

Co-authored-by: ghostloda <78798447@qq.com>
2022-08-03 13:52:25 +08:00
7 changed files with 13 additions and 59 deletions

View File

@@ -167,25 +167,6 @@ jobs:
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@v2
name: Build & Pushing CloudShell for Dockerhub, GHCR and ACR
with:
context: .
file: Dockerfile.cloudshell
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
docker.io/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/cloudshell:${{ steps.get_version.outputs.VERSION }}
publish-capabilities:
env:

View File

@@ -1,31 +0,0 @@
ARG BASE_IMAGE
# Build the cli binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
# Copy the go source
COPY apis/ apis/
COPY pkg/ pkg/
COPY version/ version/
COPY references/ references/
# Build
ARG VERSION
ARG GITVERSION
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -a -ldflags "-s -w -X github.com/oam-dev/kubevela/version.VelaVersion=${VERSION:-undefined} -X github.com/oam-dev/kubevela/version.GitRevision=${GITVERSION:-undefined}" \
-o vela ./references/cmd/cli/main.go
FROM hub.kubevela.net/oamdev/cloudshell:v0.2.1
RUN apt-get install -y vim
ENV API_TOKEN_PATH=/usr/local/kubeconfig/token
COPY --from=builder /workspace/vela /usr/local/bin/vela

View File

@@ -1,3 +1,4 @@
{{- if not (lookup "v1" "ConfigMap" (include "systemDefinitionNamespace" .) "component-pod-view") }}
apiVersion: v1
data:
template: |
@@ -72,4 +73,5 @@ data:
kind: ConfigMap
metadata:
name: component-pod-view
namespace: {{ include "systemDefinitionNamespace" . }}
namespace: {{ include "systemDefinitionNamespace" . }}
{{- end }}

View File

@@ -1,3 +1,4 @@
{{- if not (lookup "v1" "ConfigMap" (include "systemDefinitionNamespace" .) "component-service-view") }}
apiVersion: v1
data:
template: |
@@ -45,4 +46,5 @@ data:
kind: ConfigMap
metadata:
name: component-service-view
namespace: {{ include "systemDefinitionNamespace" . }}
namespace: {{ include "systemDefinitionNamespace" . }}
{{- end}}

View File

@@ -683,7 +683,7 @@ func RenderDefinitions(addon *InstallPackage, config *rest.Config) ([]*unstructu
for _, def := range addon.Definitions {
obj, err := renderObject(def)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "render definition file %s", def.Name)
}
// we should ignore the namespace defined in definition yaml, override the filed by DefaultKubeVelaNS
obj.SetNamespace(types.DefaultKubeVelaNS)
@@ -712,7 +712,7 @@ func RenderDefinitionSchema(addon *InstallPackage) ([]*unstructured.Unstructured
for _, teml := range addon.DefSchemas {
u, err := renderSchemaConfigmap(teml)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "render uiSchema file %s", teml.Name)
}
schemaConfigmaps = append(schemaConfigmaps, u)
}
@@ -725,14 +725,14 @@ func RenderViews(addon *InstallPackage) ([]*unstructured.Unstructured, error) {
for _, view := range addon.YAMLViews {
obj, err := renderObject(view)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "render velaQL view file %s", view.Name)
}
views = append(views, obj)
}
for _, view := range addon.CUEViews {
obj, err := renderCUEView(view)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "render velaQL view file %s", view.Name)
}
views = append(views, obj)
}
@@ -796,7 +796,7 @@ func renderK8sObjectsComponent(elems []ElementFile, addonName string) (*common2.
for _, elem := range elems {
obj, err := renderObject(elem)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "render resource file %s", elem.Name)
}
objects = append(objects, obj)
}

View File

@@ -328,7 +328,7 @@ func renderResources(addon *InstallPackage, args map[string]interface{}) ([]comm
if len(addon.YAMLTemplates) != 0 {
comp, err := renderK8sObjectsComponent(addon.YAMLTemplates, addon.Name)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "render components from yaml template")
}
resources = append(resources, *comp)
}

View File

@@ -461,7 +461,7 @@ func checkConflictDefs(ctx context.Context, k8sClient client.Client, defs []*uns
}
}
if err != nil && !errors2.IsNotFound(err) {
return nil, err
return nil, errors.Wrapf(err, "check definition %s", def.GetName())
}
}
return res, nil