我的任务是向all deployments,添加一个名为“ app”的标签daemonsets,cronjobs以便在监视工具中更轻松地查询整个堆栈中的应用。这样,我们可以构建使用单个选择器(即应用程序)的仪表板。
为了避免停机,我决定通过以下步骤解决此问题:
在$ kubectl apply用于更新资源时,我已将“ app”标签添加到“ app”标签/将“ service”标签替换为“ app”标签,但遇到以下错误:
来自服务器的错误(无效):将补丁程序{{ longAssPatchWhichIWon'tIncludeButYaGetThePoint } 应用于以下错误:&{0xc421b02f00 0xc420803650默认设置清单/prod/provisioning-deployment.yaml 0xc 42000c6f8 3942200 false} for:“清单/要求。 yaml”:Deployment.apps“配置”无效:s pec.template.metadata.labels:无效值:map [string] string {“ app”:“配置”,“ component”:“ marketplace”}:
selector不匹配模板labels
我需要一些为什么会引发此错误的见解。
我一直试图以多种方式解决下面的问题(递归地,使用Go-version of do while循环,并使用for循环).但是他们每个人都进入了一个无限循环.我尝试在JavaScript中使用相同的解决方案,它完全正常.有人可以帮助我理解为什么下面的解决方案无法正常工作/进行无限循环?
// Write a function that takes in a number and returns the next number that is divisible by 7
package main
func solution9(num int) int {
var done bool = false
var result int = 0
for i := 1; done != true; i++ {
if (num + i % 7 == 0) {
result = num + i
done = true
}
}
return result
}
Run Code Online (Sandbox Code Playgroud) 我不知道如何在不遇到几个嵌套函数问题的情况下解决这个 Go 算法问题。其中之一是,"cannot use func literal (type func()) as type func() string in return argument"。
我现在正在使用的解决方案是:
// Write a function that takes in 2 numbers (a, b) and a function.
// It should execute the function after a milliseconds,
// and then execute the function again after b milliseconds.
package main
import "time"
func newFunc(b int, fn func() string) func() string {
return func() {
time.AfterFunc(time.Duration(b)*time.Second, fn)
}
}
func solution10(a, b int, fn func() string) string { …Run Code Online (Sandbox Code Playgroud)