Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ require (
github.com/KimMachineGun/automemlimit v0.7.5
github.com/google/go-cmp v0.7.0
github.com/karmada-io/api v1.15.0
github.com/onsi/ginkgo/v2 v2.28.1
github.com/onsi/gomega v1.42.1
github.com/onsi/gomega v1.42.1 // indirect
github.com/prometheus/client_golang v1.23.2
github.com/stretchr/testify v1.11.1
// Pinned to network-services-operator main: the latest tag (v0.26.0)
// predates the Prepared condition this gate reads. Re-pin to a tagged
// release once one carries it.
go.datum.net/network-services-operator v0.26.1-0.20260821014231-aceb24b1b569
// Pinned to the unmerged network-services-operator proto/network-service
// branch: no tag yet carries the Prepared condition this gate reads or the
// HolderAvailable constants. Re-pin to a tagged release once one does.
go.datum.net/network-services-operator v0.26.2-0.20260826204227-4d2b3e3b8ad5
go.miloapis.com/milo v0.32.0
golang.org/x/crypto v0.54.0
golang.org/x/sync v0.22.0
Expand Down Expand Up @@ -89,7 +88,6 @@ require (

require (
cel.dev/expr v0.25.2 // indirect
github.com/Masterminds/semver/v3 v3.5.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
Expand All @@ -106,10 +104,8 @@ require (
github.com/go-openapi/jsonpointer v0.23.1 // indirect
github.com/go-openapi/jsonreference v0.21.6 // indirect
github.com/go-openapi/swag v0.25.4 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/cel-go v0.26.0 // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down Expand Up @@ -141,14 +137,12 @@ require (
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
golang.org/x/mod v0.37.0 // indirect
golang.org/x/net v0.56.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0
golang.org/x/text v0.40.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.47.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
Expand Down
26 changes: 2 additions & 24 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx5
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs=
github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE=
github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
Expand Down Expand Up @@ -151,8 +145,6 @@ github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=
github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down Expand Up @@ -188,8 +180,6 @@ github.com/in-toto/in-toto-golang v0.10.0 h1:+s2eZQSK3WmWfYV85qXVSBfqgawi/5L02Ma
github.com/in-toto/in-toto-golang v0.10.0/go.mod h1:wjT4RiyFlLWCmLUJjwB8oZcjaq7HA390aMJcD3xXgmg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE=
github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/karmada-io/api v1.15.0 h1:6Dx+Q36LaoPqKM4gduUuhSBQ3eKjKusjkvmggLpt9xs=
Expand All @@ -204,14 +194,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4=
github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
github.com/moby/buildkit v0.29.0 h1:wxLEFbCOJntEDjSNNN2YWd8zxltZxT5muDQ0LzpbtpU=
github.com/moby/buildkit v0.29.0/go.mod h1:Dmv2FeDe34t75QuzeU87rBoZpAAkcpT5zeu4hXzmASc=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
Expand Down Expand Up @@ -312,14 +298,6 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/tonistiigi/fsutil v0.0.0-20251211185533-a2aa163d723f h1:Z4NEQ86qFl1mHuCu9gwcE+EYCwDKfXAYXZbdIXyxmEA=
github.com/tonistiigi/fsutil v0.0.0-20251211185533-a2aa163d723f/go.mod h1:BKdcez7BiVtBvIcef90ZPc6ebqIWr4JWD7+EvLm6J98=
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 h1:2f304B10LaZdB8kkVEaoXvAMVan2tl9AiK4G0odjQtE=
Expand All @@ -336,8 +314,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.datum.net/datumctl v0.17.1-0.20260710003126-296c2fcbbd67 h1:Mhgt688CeTh2hX7ql61ySR3+/YHdZMgYBSFhBW7W2gA=
go.datum.net/datumctl v0.17.1-0.20260710003126-296c2fcbbd67/go.mod h1:6skEjcE7aT8VPf/HVamA/BB6Dc9IISA6c/DdYKhqWNc=
go.datum.net/network-services-operator v0.26.1-0.20260821014231-aceb24b1b569 h1:14vajo15fGGEAmdystQEE261rFH4AqER9s1Vg7POUKo=
go.datum.net/network-services-operator v0.26.1-0.20260821014231-aceb24b1b569/go.mod h1:A7JNOuc+e6j/KkUVCcZ7Z2odvf6JFMQlX0Zo1Awj2TY=
go.datum.net/network-services-operator v0.26.2-0.20260826204227-4d2b3e3b8ad5 h1:HkVPoVWAHkpD8YAyL43YylNhMk3whVEH/kYMuBY2Yss=
go.datum.net/network-services-operator v0.26.2-0.20260826204227-4d2b3e3b8ad5/go.mod h1:A7JNOuc+e6j/KkUVCcZ7Z2odvf6JFMQlX0Zo1Awj2TY=
go.miloapis.com/milo v0.32.0 h1:TkNIQu/37d+SEquLJ5+GmdisSl+K2RT7eEC4idg6RIs=
go.miloapis.com/milo v0.32.0/go.mod h1:GKK3afjCwshfZfvhjNe1wp/H45z4m7x5oG/8xbSgU1M=
go.miloapis.com/service-catalog v0.4.0 h1:LvO1WCHMCoFokpS5igWMP8kyqly9gUFQmQj5IGhwuKs=
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/instance_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func TestReconcileInstanceReadyCondition(t *testing.T) {
}

changed, err := reconciler.reconcileInstanceReadyCondition(
ctx,
t.Context(),
nil,
tt.instance,
networkFailureFunc,
Expand Down
17 changes: 2 additions & 15 deletions internal/controller/networkinterface_holder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,12 @@ import (
networkingv1alpha "go.datum.net/network-services-operator/api/v1alpha"
)

// networkInterfaceHolderAvailable is the condition compute publishes on every
// NetworkInterface an instance holds, reporting whether the holder considers
// itself able to serve. Networking selects members by it without ever learning
// that the holder is a workload.
//
// It is deliberately not NetworkInterfacePhaseAvailable, which reports that no
// claim holds the interface — the opposite of a healthy holder.
const networkInterfaceHolderAvailable = "HolderAvailable"

const (
// holderReasonNotReported covers an interface whose holder has published no
// availability state at all, which is not the same as a holder that reported
// itself unavailable.
holderReasonNotReported = "HolderNotReported"

// holderReasonUnavailable is the fallback for a holder that reported itself
// unavailable without naming a reason.
holderReasonUnavailable = "HolderUnavailable"

// holderReasonTerminating covers a holder being deleted. Its own Available
// condition can still read True for the whole deletion window, so deletion is
// judged before it.
Expand All @@ -56,7 +43,7 @@ const (
// member that cannot be vouched for must drain rather than keep taking traffic.
func holderAvailableCondition(instance *computev1alpha.Instance) metav1.Condition {
condition := metav1.Condition{
Type: networkInterfaceHolderAvailable,
Type: networkingv1alpha.NetworkInterfaceHolderAvailable,
Status: metav1.ConditionFalse,
Reason: holderReasonNotReported,
Message: msgHolderNotReported,
Expand Down Expand Up @@ -87,7 +74,7 @@ func holderAvailableCondition(instance *computev1alpha.Instance) metav1.Conditio
if available.Reason != "" {
condition.Reason = available.Reason
} else {
condition.Reason = holderReasonUnavailable
condition.Reason = networkingv1alpha.NetworkInterfaceReasonHolderUnavailable
}
condition.Message = available.Message
if condition.Message == "" {
Expand Down
8 changes: 4 additions & 4 deletions internal/controller/networkinterface_holder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func getHolderCondition(t *testing.T, cl client.Client) *metav1.Condition {
Namespace: claimTestNamespace,
Name: holderTestInterface,
}, &networkInterface))
return apimeta.FindStatusCondition(networkInterface.Status.Conditions, networkInterfaceHolderAvailable)
return apimeta.FindStatusCondition(networkInterface.Status.Conditions, networkingv1alpha.NetworkInterfaceHolderAvailable)
}

// TestHolderAvailableCondition covers the translation from the instance's own
Expand Down Expand Up @@ -144,7 +144,7 @@ func TestHolderAvailableCondition(t *testing.T) {

condition := holderAvailableCondition(newHolderTestInstance(tc.available))

assert.Equal(t, networkInterfaceHolderAvailable, condition.Type)
assert.Equal(t, networkingv1alpha.NetworkInterfaceHolderAvailable, condition.Type)
assert.Equal(t, tc.wantStatus, condition.Status)
assert.Equal(t, tc.wantReason, condition.Reason)
assert.Equal(t, tc.wantMessage, condition.Message)
Expand Down Expand Up @@ -346,7 +346,7 @@ func TestReconcileDeletion_Drains(t *testing.T) {

networkInterface := newHolderTestInterface()
apimeta.SetStatusCondition(&networkInterface.Status.Conditions, metav1.Condition{
Type: networkInterfaceHolderAvailable,
Type: networkingv1alpha.NetworkInterfaceHolderAvailable,
Status: metav1.ConditionTrue,
Reason: computev1alpha.InstanceAvailableReasonAvailable,
})
Expand Down Expand Up @@ -426,7 +426,7 @@ func TestReconcileHolderAvailability_StaleTrueNotInherited(t *testing.T) {

retained := newHolderTestInterface()
apimeta.SetStatusCondition(&retained.Status.Conditions, metav1.Condition{
Type: networkInterfaceHolderAvailable,
Type: networkingv1alpha.NetworkInterfaceHolderAvailable,
Status: metav1.ConditionTrue,
Reason: computev1alpha.InstanceAvailableReasonAvailable,
Message: msgInstanceAvailable,
Expand Down
82 changes: 0 additions & 82 deletions internal/controller/suite_test.go

This file was deleted.

Loading