mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Fix storage node affinity helpers
This commit is contained in:
parent
1a280993a9
commit
5fcb82dde9
@ -613,6 +613,10 @@ func GetStorageNodeAffinityFromAnnotation(annotations map[string]string) (*api.N
|
|||||||
// Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes
|
// Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes
|
||||||
// TODO: update when storage node affinity graduates to beta
|
// TODO: update when storage node affinity graduates to beta
|
||||||
func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *api.NodeAffinity) error {
|
func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *api.NodeAffinity) error {
|
||||||
|
if affinity == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
json, err := json.Marshal(*affinity)
|
json, err := json.Marshal(*affinity)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -517,6 +517,10 @@ func GetStorageNodeAffinityFromAnnotation(annotations map[string]string) (*v1.No
|
|||||||
// Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes
|
// Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes
|
||||||
// TODO: update when storage node affinity graduates to beta
|
// TODO: update when storage node affinity graduates to beta
|
||||||
func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *v1.NodeAffinity) error {
|
func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *v1.NodeAffinity) error {
|
||||||
|
if affinity == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
json, err := json.Marshal(*affinity)
|
json, err := json.Marshal(*affinity)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -613,6 +613,10 @@ func GetStorageNodeAffinityFromAnnotation(annotations map[string]string) (*api.N
|
|||||||
// Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes
|
// Converts NodeAffinity type to Alpha annotation for use in PersistentVolumes
|
||||||
// TODO: update when storage node affinity graduates to beta
|
// TODO: update when storage node affinity graduates to beta
|
||||||
func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *api.NodeAffinity) error {
|
func StorageNodeAffinityToAlphaAnnotation(annotations map[string]string, affinity *api.NodeAffinity) error {
|
||||||
|
if affinity == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
json, err := json.Marshal(*affinity)
|
json, err := json.Marshal(*affinity)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user