我的客户将请求多个数字,我需要相互比较值。
我想要如下代码。
const validator: SomeValidator = new SomeValidator;
validator.first = 1000;
validator.second = 2000; // this will be greater than validator.first
validator.third = 3000; // this will be greater than validator.second
Run Code Online (Sandbox Code Playgroud)
我尝试将变量输入到 @Min() 验证器中,如下所示
import { IsInt, Min } from 'class-validator';
class SomeValidator {
@IsInt()
@Min(0)
public first: number;
@IsInt()
@Min(this.first) // it occurs TS7017
public second: number;
@IsInt()
@Min(this.second) // it occurs TS7017
public third: number;
}
Run Code Online (Sandbox Code Playgroud)
我收到TS7017 错误。
TS7017: Element implicitly has an 'any' type …
Run Code Online (Sandbox Code Playgroud) 我正在本地使用kubernetes
虽然我使用kubernetes构建gitlab有一些问题。我认为这与serviceaccount或角色绑定有关。但找不到正确的方法
我找到了这些帖子
Kubernetes日志,用户“ system:serviceaccount:default:default”无法在名称空间中获取服务
https://github.com/kubernetes/kops/issues/3551
==> /var/log/gitlab/prometheus/current <==
2018-12-24_03:06:08.88786 level=error ts=2018-12-24T03:06:08.887812767Z caller=main.go:240 component=k8s_client_runtime err="github.com/prometheus/prometheus/discovery/kubernetes/kubernetes.go:372: Failed to list *v1.Node: nodes is forbidden: User \"system:serviceaccount:default:default\" cannot list resource \"nodes\" in API group \"\" at the cluster scope"
2018-12-24_03:06:08.89075 level=error ts=2018-12-24T03:06:08.890719525Z caller=main.go:240 component=k8s_client_runtime err="github.com/prometheus/prometheus/discovery/kubernetes/kubernetes.go:320: Failed to list *v1.Pod: pods is forbidden: User \"system:serviceaccount:default:default\" cannot list resource \"pods\" in API group \"\" at the cluster scope"
Run Code Online (Sandbox Code Playgroud)