diff --git a/0001-authz-print-error-instead-of-panic-when-start-server.patch b/0001-authz-print-error-instead-of-panic-when-start-server.patch new file mode 100644 index 0000000000000000000000000000000000000000..bf7e42f82721808e4d1667c9709440e059a458eb --- /dev/null +++ b/0001-authz-print-error-instead-of-panic-when-start-server.patch @@ -0,0 +1,26 @@ +From d6f2fd94f8693c0b5031b9a3235f1888b22864d8 Mon Sep 17 00:00:00 2001 +From: zhangsong234 +Date: Mon, 1 Mar 2021 15:18:48 +0800 +Subject: [PATCH] authz: print error instead of panic when start server failed + +Signed-off-by: zhangsong234 +--- + main.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/main.go b/main.go +index 8f8578b..06ac4c2 100644 +--- a/main.go ++++ b/main.go +@@ -77,7 +77,7 @@ func main() { + go func() { + err = srv.Start() + if err != nil { +- panic(err) ++ logrus.Errorf("failed to start server: %s", err) + } + }() + ch := make(chan os.Signal, 1) +-- +2.27.0 + diff --git a/authz.spec b/authz.spec index f4a134e564bcef8e7b2d43663eb4e16790d48031..a7fa27efcf6105ce07c14428ef091dd0403651f5 100644 --- a/authz.spec +++ b/authz.spec @@ -2,13 +2,15 @@ Name: authz Version: 0.1 -Release: 2 +Release: 3 Summary: a isula auth plugin for RBAC License: Mulan PSL v2 URL: https://gitee.com/openeuler/authz Source0: https://gitee.com/openeuler/authz/repository/archive/v%{version}.tar.gz BuildRoot: %{_tmppath}/authz-root +Patch0001: 0001-authz-print-error-instead-of-panic-when-start-server.patch + #Dependency BuildRequires: golang >= 1.8 BuildRequires: glibc-static @@ -19,6 +21,7 @@ Work with isulad daemon that enables TLS. It brings the support of RBAC. #Build sections %prep %setup -n %{name} -q +%patch1 -p1 %build make @@ -64,6 +67,9 @@ chmod 0640 /var/lib/authz-broker/policy.json rm -rfv %{buildroot} %changelog +* Mon Mar 01 2021 zhangsong234 - 0.1-3 +- pirnt error instead of panic when start server + * Mon Sep 07 2020 wangkang101 <873229877@qq.com> - 0.1-2 - modify url of source0