Skip to content

Commit 6026fe3

Browse files
sync: update external libs (rh-ecosystem-edge#1073)
Co-authored-by: klaskosk <[email protected]>
1 parent 3720db5 commit 6026fe3

File tree

3 files changed

+104
-28
lines changed

3 files changed

+104
-28
lines changed

pkg/schemes/nvidiagpu/nvidiagputypes/clusterpolicy_types.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
2727
corev1 "k8s.io/api/core/v1"
2828
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
29+
"k8s.io/utils/ptr"
2930
)
3031

3132
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
@@ -2094,3 +2095,29 @@ func (c *CCManagerSpec) IsEnabled() bool {
20942095
}
20952096
return *c.Enabled
20962097
}
2098+
2099+
// +kubebuilder:object:generate=false
2100+
type ConfigWithName interface {
2101+
GetName() string
2102+
}
2103+
2104+
// GetConfigMapName returns the config's name if it's non-empty and differs from defaultName,
2105+
// otherwise returns defaultName. The boolean indicates whether a custom name was used.
2106+
func GetConfigMapName[T ConfigWithName](config T, defaultName string) (string, bool) {
2107+
if name := config.GetName(); name != "" {
2108+
return name, name != defaultName
2109+
}
2110+
return defaultName, false
2111+
}
2112+
2113+
func (c *MIGGPUClientsConfigSpec) GetName() string {
2114+
return ptr.Deref(c, MIGGPUClientsConfigSpec{}).Name
2115+
}
2116+
2117+
func (c *MIGPartedConfigSpec) GetName() string {
2118+
return ptr.Deref(c, MIGPartedConfigSpec{}).Name
2119+
}
2120+
2121+
func (c *VGPUDevicesConfigSpec) GetName() string {
2122+
return ptr.Deref(c, VGPUDevicesConfigSpec{}).Name
2123+
}

pkg/schemes/ocs/noobaa/noobaa_types.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ type NooBaaSpec struct {
157157

158158
// Affinity (optional) passed through to noobaa's pods
159159
// +optional
160-
Affinity *corev1.Affinity `json:"affinity,omitempty"`
160+
Affinity *AffinitySpec `json:"affinity,omitempty"`
161161

162162
// ImagePullSecret (optional) sets a pull secret for the system image
163163
// +optional
@@ -242,6 +242,24 @@ type NooBaaSpec struct {
242242
BucketNotifications BucketNotificationsSpec `json:"bucketNotifications,omitempty"`
243243
}
244244

245+
// Affinity is a group of affinity scheduling rules.
246+
type AffinitySpec struct {
247+
// Describes node affinity scheduling rules for the pod.
248+
// +optional
249+
NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeAffinity"`
250+
// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
251+
// +optional
252+
PodAffinity *corev1.PodAffinity `json:"podAffinity,omitempty" protobuf:"bytes,2,opt,name=podAffinity"`
253+
// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
254+
// +optional
255+
PodAntiAffinity *corev1.PodAntiAffinity `json:"podAntiAffinity,omitempty" protobuf:"bytes,3,opt,name=podAntiAffinity"`
256+
257+
// TopologyKey (optional) the TopologyKey to pass as the domain for TopologySpreadConstraint and Affinity of noobaa components
258+
// It is used by the endpoints and the DB pods to control pods distribution between topology domains (host/zone)
259+
// +optional
260+
TopologyKey string `json:"topologyKey,omitempty"`
261+
}
262+
245263
// AutoscalerSpec defines different actoscaling spec such as autoscaler type and prometheus namespace
246264
type AutoscalerSpec struct {
247265
// Type of autoscaling (optional) for noobaa-endpoint, hpav2(default) and keda - Prometheus metrics based
@@ -640,7 +658,7 @@ const (
640658
// DeleteOBCConfirmation represents the validation to destry obc
641659
DeleteOBCConfirmation CleanupConfirmationProperty = "yes-really-destroy-obc"
642660

643-
// SkipTopologyConstraints is Annotation name for disabling default topology Constraints
661+
// SkipTopologyConstraints is Annotation name for skipping the reconciliation of the default topology Constraints
644662
SkipTopologyConstraints = "noobaa.io/skip_topology_spread_constraints"
645663

646664
// DisableDBDefaultMonitoring is Annotation name for disabling default db monitoring

pkg/schemes/ocs/noobaa/zz_generated.deepcopy.go

Lines changed: 57 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)