我试图从文件中读取值以创建一个结构体,但我遇到了一对奇怪的错误。我的代码的超级基本实现:
extern crate itertools;
use itertools::Itertools;
use std::io::{self, prelude::*, BufReader};
use std::fs::{self, File};
// The struct I will unpack into
struct BasicExample {
a: String,
b: String,
c: String,
d: String,
}
impl BasicExample {
pub fn new(a: String, b: String, c: String, d: String} -> Self {
BasicExample {
a, b, c, d
}
}
// I'm expecting that reading from the config file might fail, so
// I want to return a Result that can be unwrapped. Otherwise …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Azure 门户定位 Azure DataLake Store Gen2,但由于某种原因找不到它:
我一直在搜索文档和门户网站,但似乎找不到,有没有其他人遇到过这个问题?自 2 月以来一直在全球 GA 中,所以我认为这不是问题。我已经查看了有关如何创建存储帐户的文档,这是创建 gen2 实例所需的全部内容吗?
这是一个非常基本的问题,我似乎无法找到答案,但我无法弄清楚如何在cronjob中设置concurrencyPolicy.我尝试过当前文件配置的变体:
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: job-newspaper
spec:
schedule: "* */3 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: job-newspaper
image: bdsdev.azurecr.io/job-newspaper:latest
imagePullPolicy: Always
resources:
limits:
cpu: "2048m"
memory: "10G"
requests:
cpu: "512m"
memory: "2G"
command: ["spark-submit","/app/newspaper_job.py"]
restartPolicy: OnFailure
concurrencyPolicy: Forbid
Run Code Online (Sandbox Code Playgroud)
当我运行时,kubectl create -f ./job.yaml我收到以下错误:
error: error validating "./job.yaml": error validating data:
ValidationError(CronJob.spec.jobTemplate.spec.template.spec): unknown
field "concurrencyPolicy" in io.k8s.api.core.v1.PodSpec; if you choose
to ignore these errors, turn validation off with --validate=false
Run Code Online (Sandbox Code Playgroud)
我可能要么把这个属性放在错误的地方或称它为错误的名称,我只是在文档中找不到它.谢谢!