golang 的不可变(Immutable)编程
不可变编程是一种编程思想。简单地说,就是对象的属性只能set一次。 ImmutableEphemeralVolume(immutable secret) 以 kubernetes 最近(2019年年底)的一个 ImmutableEphemeralVolume 为例。 我看了一下源代码,大意就是说,configmap 和 secret 在创建后不可更新。 以 secret 为例,目前(2020-04-16)secret 的定义是这样的: // Secret holds secret data of a certain type. The total bytes of the values in // the Data field must be less than MaxSecretSize bytes. type Secret struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/de...