1 Star 0 Fork 10

misaka00251/eggo

forked from src-openEuler/eggo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-disable-service-beforce-setup-service.patch 3.79 KB
一键复制 编辑 原始数据 按行查看 历史
zhangxiaoyu 提交于 2021-11-26 09:39 . upgrade to v0.9.4-2
From 5d7a00a385e3510efdac8fc44046956417c6f7e9 Mon Sep 17 00:00:00 2001
From: zhangxiaoyu <zhangxiaoyu58@huawei.com>
Date: Tue, 2 Nov 2021 16:19:38 +0800
Subject: [PATCH 02/12] disable service beforce setup service
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
---
Makefile | 8 ++++++--
eggops.yaml | 2 +-
.../binary/cleanupcluster/cleanupcommon.go | 2 +-
.../binary/commontools/systemdservices.go | 2 ++
pkg/clusterdeployment/runtime/runtime.go | 2 +-
5 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 9722c0c..3fac780 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,11 @@
GIT_COMMIT ?= $(if $(shell git rev-parse --short HEAD),$(shell git rev-parse --short HEAD),$(error "commit id failed"))
SOURCE_DATE_EPOCH ?= $(if $(shell date +%s),$(shell date +%s),$(error "date failed"))
VERSION := $(shell cat ./VERSION)
-ARCH := $(shell arch)
+# eggo arch amd64/arm64
+ARCH ?= amd64
+ifeq ($(shell uname -p),aarch64)
+ARCH ?= arm64
+endif
EXTRALDFLAGS :=
LDFLAGS := -X isula.org/eggo/cmd.Version=$(VERSION) \
@@ -13,7 +17,7 @@ STATIC_LDFLAGS := -extldflags=-static -linkmode=external
SAFEBUILDFLAGS := -buildmode=pie -extldflags=-ftrapv -extldflags=-zrelro -extldflags=-znow -tmpdir=/tmp/xxeggo $(LDFLAGS)
GO := go
-GO_BUILD := CGO_ENABLED=0 $(GO)
+GO_BUILD := CGO_ENABLED=0 GOARCH=$(ARCH) $(GO)
.PHONY: eggo
eggo:
diff --git a/eggops.yaml b/eggops.yaml
index 606f4da..419854a 100644
--- a/eggops.yaml
+++ b/eggops.yaml
@@ -1626,7 +1626,7 @@ spec:
containers:
- command:
- /manager
- image: hub.oepkgs.net/haozi007/eggops:v1.0.0-alpha
+ image: hub.oepkgs.net/haozi007/eggops:1.0.0-alpha
livenessProbe:
httpGet:
path: /healthz
diff --git a/pkg/clusterdeployment/binary/cleanupcluster/cleanupcommon.go b/pkg/clusterdeployment/binary/cleanupcluster/cleanupcommon.go
index 8220746..e681b63 100644
--- a/pkg/clusterdeployment/binary/cleanupcluster/cleanupcommon.go
+++ b/pkg/clusterdeployment/binary/cleanupcluster/cleanupcommon.go
@@ -43,7 +43,7 @@ func PostCleanup(r runner.Runner) {
func stopServices(r runner.Runner, services []string) error {
join := strings.Join(services, " ")
- if _, err := r.RunCommand(fmt.Sprintf("sudo -E /bin/sh -c \"systemctl stop %s\"", join)); err != nil {
+ if _, err := r.RunCommand(fmt.Sprintf("sudo -E /bin/sh -c \"systemctl stop %s && systemctl disable %s\"", join, join)); err != nil {
logrus.Errorf("stop services failed: %v", err)
return err
}
diff --git a/pkg/clusterdeployment/binary/commontools/systemdservices.go b/pkg/clusterdeployment/binary/commontools/systemdservices.go
index 790d3d4..e500aab 100644
--- a/pkg/clusterdeployment/binary/commontools/systemdservices.go
+++ b/pkg/clusterdeployment/binary/commontools/systemdservices.go
@@ -406,8 +406,10 @@ func GetSystemdServiceShell(name string, base64Data string, needRestart bool) (s
shell := `
#!/bin/bash
{{- if .content }}
+systemctl disable {{ .name }}
rm -f /usr/lib/systemd/system/{{ .name }}.service
echo {{ .content }} | base64 -d > /usr/lib/systemd/system/{{ .name }}.service
+systemctl daemon-reload
{{- end }}
which chcon
if [ $? -eq 0 ]; then
diff --git a/pkg/clusterdeployment/runtime/runtime.go b/pkg/clusterdeployment/runtime/runtime.go
index 021ce58..ca5e265 100644
--- a/pkg/clusterdeployment/runtime/runtime.go
+++ b/pkg/clusterdeployment/runtime/runtime.go
@@ -177,7 +177,7 @@ Type=notify
EnvironmentFile=-/etc/sysconfig/docker
ExecStart=/usr/bin/dockerd \
{{- range $i, $v := .registry }}
- --registry-mirrors {{ $v }} \
+ --registry-mirror {{ $v }} \
{{- end }}
{{- range $i, $v := .insecure }}
--insecure-registry {{ $v }} \
--
2.25.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/misaka00251/eggo.git
git@gitee.com:misaka00251/eggo.git
misaka00251
eggo
eggo
master

搜索帮助