当前位置:网站首页>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)
}
边栏推荐
- Is it safe for golden sun to open an account? Can I open an account free of 5 in case?
- Video fusion cloud platform easycvr adds multi-level grouping, which can flexibly manage access devices
- Trust counts the number of occurrences of words in the file
- 案例分享|金融业数据运营运维一体化建设
- 达梦数据库udf实现
- A2L file parsing based on CAN bus (3)
- ROS安装报错 sudo: rosdep:找不到命令
- Word查找红色文字 Word查找颜色字体 Word查找突出格式文本
- U-Net: Convolutional Networks for Biomedical Images Segmentation
- 蚂蚁集团开源可信隐私计算框架「隐语」:开放、通用
猜你喜欢

MySQL优化六个点的总结

Insufficient picture data? I made a free image enhancement software

Use QT to traverse JSON documents and search sub objects

案例分享|金融业数据运营运维一体化建设

MYSQL中 find_in_set() 函数用法详解

Redhat7.4 configure Yum software warehouse (rhel7.4)

如何快速进阶自动化测试?听听这3位BAT大厂测试工程师的切身感想....

【HCIA-cloud】【1】云计算的定义、什么是云计算、云计算的架构与技术说明、华为云计算产品、华为内存DDR配置工具说明

Summary of six points of MySQL optimization

技术分享 | 接口测试价值与体系
随机推荐
lombok @Builder注解
案例分享|金融业数据运营运维一体化建设
Lombok @builder annotation
Tianyi cloud understands enterprise level data security in this way
How much does the mlperf list weigh when AI is named?
Linear table - abstract data type
线性表——抽象数据类型
7-1 链表也简单fina
[QNX hypervisor 2.2 user manual]6.3.2 configuring VM
websocket 工具的使用
Idea configuring NPM startup
Trust counts the number of occurrences of words in the file
为什么 BI 软件都搞不定关联分析?带你分析分析
Ant group open source trusted privacy computing framework "argot": open and universal
Memory leak of viewpager + recyclerview
SAP feature description
EasyCVR电子地图中设备播放器loading样式的居中对齐优化
Is it safe to open an account, register and dig money? Is there any risk? Is it reliable?
Vulnhub's darkhole_ two
RedHat7.4配置yum软件仓库(RHEL7.4)