-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
Network
peering controller and extend `NetworkPeeringStat…
…us` with `State` field (#1026) * Extend NetworkPeeringStatus with State field * Implement network peering controller and add tests * change network peering status state name from Initial to Pending * modify network protection controller to keep finalizer if it has valid peering * fix claimer key creation in network release controller
- Loading branch information
Showing
14 changed files
with
1,024 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 14 additions & 1 deletion
15
client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package networking | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/ironcore-dev/ironcore/api/networking/v1alpha1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
const NetworkSpecPeeringClaimRefNamesField = "network-spec-peering-claim-ref-names" | ||
|
||
func SetupNetworkSpecPeeringClaimRefNamesFieldIndexer(ctx context.Context, indexer client.FieldIndexer) error { | ||
return indexer.IndexField(ctx, &v1alpha1.Network{}, NetworkSpecPeeringClaimRefNamesField, func(obj client.Object) []string { | ||
network := obj.(*v1alpha1.Network) | ||
peeringClaimRefNames := make([]string, 0, len(network.Spec.PeeringClaimRefs)) | ||
for _, peeringClaimRef := range network.Spec.PeeringClaimRefs { | ||
peeringClaimRefNames = append(peeringClaimRefNames, peeringClaimRef.Name) | ||
} | ||
|
||
if len(peeringClaimRefNames) == 0 { | ||
return []string{""} | ||
} | ||
return peeringClaimRefNames | ||
}) | ||
} |
Oops, something went wrong.