我有这个持久的音量声明
$ kubectl get pvc -ngitlab-managed-apps
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
prometheus-prometheus-server Pending 0s
$ kubectl describe pvc prometheus-prometheus-server -ngitlab-managed-apps
Name: prometheus-prometheus-server
Namespace: gitlab-managed-apps
StorageClass:
Status: Pending
Volume:
Labels: app=prometheus
chart=prometheus-9.5.2
component=server
heritage=Tiller
release=prometheus
Annotations: <none>
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
Mounted By: prometheus-prometheus-server-78bdf8f5b7-pkvcr
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal FailedBinding 14s (x5 over 60s) persistentvolume-controller no persistent volumes available for this claim and no storage class is set …Run Code Online (Sandbox Code Playgroud) 我在实现单例时遇到问题,因为标记为 @singleton() 的类正在每个resolve() 上重新创建。
这是例子
// Foo.ts This is singleton and and must be created only once
import { injectable, singleton } from "tsyringe";
@injectable()
@singleton()
export class Foo {
constructor() {
console.log("Constractor of Foo");
}
}
Run Code Online (Sandbox Code Playgroud)
// Bar.ts this is Bar and should be created every time. It uses the singleton
import { inject, injectable, Lifecycle, scoped } from "tsyringe";
import { Foo } from "./Foo";
@injectable()
export class Bar {
constructor(@inject("Foo") private foo: Foo) {
console.log("Constractor of Bar"); …Run Code Online (Sandbox Code Playgroud)