当前位置:网站首页>golang通过指针for...range实现切片中元素的值的更改
golang通过指针for...range实现切片中元素的值的更改
2022-07-05 18:36:00 【学亮编程手记】
*(&build.Args[2])=destination
*(&build.Args[6])=cacherepo
//解决再次编辑时,workflow template得不到更新的问题。
//最新解决方案:通过argo workflow的全局参数机制来解决
builds := argoflowObject.Spec.Templates.Build
for _, build := range builds {
repoUrl:=build.BuildFormData.RepoUrl
if strings.Contains(repoUrl,"https://"){
repoUrl=strings.ReplaceAll(build.BuildFormData.RepoUrl,"https://","")
}
if strings.Contains(repoUrl,"http://"){
repoUrl=strings.ReplaceAll(build.BuildFormData.RepoUrl,"http://","")
}
finalImageName:=repoUrl+"/"+build.BuildFormData.ImageName+":"+build.BuildFormData.ImageTag
destination := build.Args[2]
cacherepo := build.Args[6]
destination=strings.Split(destination,"=")[0]+"="+finalImageName
cacherepo=strings.Split(cacherepo,"=")[0]+"="+repoUrl+"/"+build.BuildFormData.ImageName
*(&build.Args[2])=destination
*(&build.Args[6])=cacherepo
fmt.Println("build.Args:",build.Args)
}
边栏推荐
- 5. Data access - entityframework integration
- Use QT to traverse JSON documents and search sub objects
- Redhat7.4 configure Yum software warehouse (rhel7.4)
- Cronab log: how to record the output of my cron script
- ICML2022 | 长尾识别中分布外检测的部分和非对称对比学习
- LeetCode 6109. Number of people who know the secret
- 从外卖点单浅谈伪需求
- AI金榜题名时,MLPerf榜单的份量究竟有多重?
- The era of Web3.0 is coming. See how Tianyi cloud storage resources revitalize the system to enable new infrastructure (Part 2)
- Reading notes of Clickhouse principle analysis and Application Practice (5)
猜你喜欢

Use of websocket tool

Oracle 中文排序 Oracle 中文字段排序
![2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]](/img/c9/f4ab4578029cf043155a5811a64489.png)
2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]

一朵云开启智慧交通新未来
![[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD](/img/b8/624799e4bf788e4476b155486f478b.png)
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD

Ant group open source trusted privacy computing framework "argot": open and universal

Solutions contents have differences only in line separators

Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition

技术分享 | 常见接口协议解析

尚硅谷尚优选项目教程发布
随机推荐
c期末复习
企业级数据安全,天翼云是这样理解的
Windows Oracle 开启远程连接 Windows Server Oracle 开启远程连接
Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
尚硅谷尚优选项目教程发布
c语言简便实现链表增删改查「建议收藏」
The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working
Deep copy and shallow copy [interview question 3]
C final review
从外卖点单浅谈伪需求
Powerful tool for collection processing
小程序 修改样式 ( placeholder、checkbox的样式)
Share: ZTE Yuanhang 30 Pro root unlock BL magick ZTE 7532n 8040n 9041n brush mask original brush package root method Download
SAP 特征 特性 说明
视频自监督学习综述
LeetCode 6111. Spiral matrix IV
Personal understanding of convolutional neural network
2022年5月腾讯云开发者社区视频月度榜单公布
What are the cache interfaces of nailing open platform applet API?
ROS installation error sudo: rosdep: command not found