当前位置:网站首页>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)
}
边栏推荐
- Redhat7.4 configure Yum software warehouse (rhel7.4)
- A cloud opens a new future of smart transportation
- Use of websocket tool
- C final review
- The 11th China cloud computing standards and Applications Conference | cloud computing national standards and white paper series release, and Huayun data fully participated in the preparation
- Is it safe to make fund fixed investment on access letter?
- max31865模块RTD测温注意事项
- [QNX hypervisor 2.2 user manual]6.3.2 configuring VM
- c期末复习
- 7-2 keep the linked list in order
猜你喜欢
vs2017 qt的各种坑
Overview of video self supervised learning
Summary of six points of MySQL optimization
SAP 特征 特性 说明
The 11th China cloud computing standards and Applications Conference | cloud computing national standards and white paper series release, and Huayun data fully participated in the preparation
Oracle 中文排序 Oracle 中文字段排序
Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
ICML2022 | 长尾识别中分布外检测的部分和非对称对比学习
[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
Pytorch yolov5 training custom data
随机推荐
sample_rate(采样率),sample(采样),duration(时长)是什么关系
Is it complicated to open an account? Is online account opening safe?
2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]
小程序 修改样式 ( placeholder、checkbox的样式)
Powerful tool for collection processing
7-2 保持链表有序
Postman核心功能解析 —— 参数化和测试报告
The 11th China cloud computing standards and Applications Conference | cloud computing national standards and white paper series release, and Huayun data fully participated in the preparation
Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
RPC协议详解
5. 数据访问 - EntityFramework集成
Find in MySQL_ in_ Detailed explanation of set() function usage
Optimization of middle alignment of loading style of device player in easycvr electronic map
Memory leak of viewpager + recyclerview
Linear table - abstract data type
2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
Redhat7.4 configure Yum software warehouse (rhel7.4)
鱼和熊掌可以兼得!天翼云弹性裸金属一招鲜!
How to write good code defensive programming