2024年4月25日

摘要: ZACMSProject.xcodeproj: error: Invalid trust settings. Restore system default trust settings for certificate "iPhone Developer: xxxxx (xxxxxxxxxx)" in 阅读全文
posted @ 2024-04-25 12:51 dongzhiwei-blog 阅读(34) 评论(0) 推荐(0) 编辑

2024年3月25日

摘要: 在容器化应用开发中,我们经常会遇到使用 Kaniko 构建镜像并推送到镜像仓库时出现认证问题的情况。本文将介绍如何利用 Skopeo 工具来解决 Kaniko 无法登录镜像仓库的问题。 1. 问题背景 Kaniko 是一个无需特权的容器镜像构建工具,但在进行镜像推送时,需要登录到目标镜像仓库以验证身 阅读全文
posted @ 2024-03-25 10:06 dongzhiwei-blog 阅读(66) 评论(0) 推荐(0) 编辑

2024年1月5日

摘要: Go如何优雅的写数据库的单测 Go如何优雅的写数据库的单测 遇到的问题 ​ 当你想在代码中测试 Gorm 时,可以考虑使用单元测试或集成测试来确保 Gorm 的功能正常。下面是一个简单的示例,展示了如何编写一个基本的 Gorm 单元测试。 代码目录结构 app config config.yaml conf.go service 阅读全文
posted @ 2024-01-05 10:00 dongzhiwei-blog 阅读(77) 评论(0) 推荐(0) 编辑
 
摘要: Go代码测试覆盖率 目录结构 ├── main.go └── main_test.go 代码 // main.go package main import "fmt" func Divide(a, b float64) (float64, error) { if b == 0 { return 0, 阅读全文
posted @ 2024-01-05 09:59 dongzhiwei-blog 阅读(29) 评论(0) 推荐(0) 编辑

2023年12月11日

摘要: 遇到的问题 知道用户名和密码,无法登录镜像仓库 解决方案:生成认证文件,挂载进/kaniko/.docker/。比如 { "auths": { "https://your-registry.example.com": { "auth": "base64-encoded-auth-string" } 阅读全文
posted @ 2023-12-11 16:55 dongzhiwei-blog 阅读(216) 评论(0) 推荐(0) 编辑

2023年12月8日

摘要: 在 Kubernetes 中使用 ab 工具测试 HPA Kubernetes 提供了强大的横向扩展能力,可以根据负载动态调整 Pod 的副本数量。本文将介绍如何使用 ab 工具测试 Horizontal Pod Autoscaler(HPA)。 下载并安装 ab 工具 首先,确保你的系统上安装了 阅读全文
posted @ 2023-12-08 18:11 dongzhiwei-blog 阅读(31) 评论(0) 推荐(0) 编辑

2023年12月2日

摘要: 问题是什么 数据库报错 Error 1366 (HY000): Incorrect string value 具体情况复现 插入语句 insert ignore into user( name, disc_content ) select t1.name, group_concat( concat( 阅读全文
posted @ 2023-12-02 18:13 dongzhiwei-blog 阅读(77) 评论(0) 推荐(0) 编辑