我希望网站上有imports ...
...
kubeconfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
clientcmd.NewDefaultClientConfigLoadingRules(),
&clientcmd.ConfigOverrides{},
)
namespace, _, err := kubeconfig.Namespace()
if err != nil {
panic(err.Error())
}
restconfig, err := kubeconfig.ClientConfig()
if err != nil {
panic(err)
}
clientset, err := kubernetes.NewForConfig(restconfig)
if err != nil {
panic(err)
}
...
deploymentsClient := clientset.AppsV1().Deployments(namespace)
retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error {
d, getErr := deploymentsClient.Get("deployment name",
metav1.GetOptions{})
if getErr != nil {
panic(getErr)
}
d.Spec.Template.Spec.Containers[0].Resources.Requests =
make(map[v1core.ResourceName]resource.Quantity)
d.Spec.Template.Spec.Containers[0].Resources.Requests[v1core.ResourceCPU] =
*resource.NewQuantity("# of cores", resource.BinarySI)
_, updateErr := deploymentsClient.Update(d)
return updateErr
})
...
和iOS元数据,以便从Safari将网站添加到iOS主屏幕时,标题就是我在manifest.json
中指定的标题。但是当我同时拥有两者时,<meta name="apple-mobile-web-app-title" content="foo" />
中的name属性将覆盖元标记manifest.json
。
例如:
<meta name="apple-mobile-web-app-title" content="foo" />
{的<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Add to Homescreen</title>
<meta name="apple-mobile-web-app-title" content="Test name TEST 2">
<link rel="manifest" href="manifest.json">
<link rel="apple-touch-icon" href="touch-icon-iphone.png" >
<link rel="apple-touch-icon" sizes="76x76" href="http://placekitten.com/76/76">
<link rel="apple-touch-icon" sizes="120x120" href="http://placekitten.com/120/120">
<link rel="apple-touch-icon" sizes="152x152" href="http://placekitten.com/152/152">
</head>
<body>
<h1>Test Site</h1>
</body>
</html>
manifest.json
在“添加到主屏幕”界面中出现一个标题为“ WRONG NAME”的字样:
有办法两者兼得吗?