Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This repository contains the FLUIDOS Node, along with its essential components,
- [**Peering Candidates**](/docs/implementation/components.md#peering-candidates)
- [**REAR Manager**](/docs/implementation/components.md#rear-manager)
- [**Contract Manager**](/docs/implementation/components.md#contract-manager)
- [**Network Manager**](/docs/implementation/components.md#network-manager)

Please note that this repository is continually updated, with additional components slated for future inclusion.

Expand Down
23 changes: 23 additions & 0 deletions apis/network/v1alpha1/broker_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2022-2025 FLUIDOS Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1

import "github.com/fluidos-project/node/pkg/utils/tools"

// UpdateStatus updates the status of the broker.
func (broker *Broker) UpdateStatus() {
broker.Status.LastUpdateTime = tools.GetTimeNow()
broker.Status.ExpirationTime = tools.GetExpirationTime(0, 0, 10)
}
67 changes: 67 additions & 0 deletions apis/network/v1alpha1/broker_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2022-2025 FLUIDOS Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// BrokerSpec defines the desired state of Broker.
type BrokerSpec struct {

// Address of the Broker.
Address string `json:"address"`
Name string `json:"name"`
ClCert *corev1.Secret `json:"clcert"`
CaCert *corev1.Secret `json:"cacert"`
Role string `json:"role"`
}

// BrokerStatus defines the observed state of Broker.
type BrokerStatus struct {

// This field represents the expiration time of the Broker. It is used to determine when the Broker is no longer valid.
ExpirationTime string `json:"expirationTime"`

// This field represents the last update time of the Broker.
LastUpdateTime string `json:"lastUpdateTime"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:shortName=broker;brokers

// Broker is the Schema for the clusters API.
type Broker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec BrokerSpec `json:"spec,omitempty"`
Status BrokerStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// BrokerList contains a list of Broker.
type BrokerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Broker `json:"items"`
}

func init() {
SchemeBuilder.Register(&Broker{}, &BrokerList{})
}
100 changes: 100 additions & 0 deletions apis/network/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/network-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ func main() {
}

// Register the controller
if err = (&networkmanager.KnownClusterReconciler{
if err = (&networkmanager.BrokerReconciler{
Client: cl,
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "KnownCluster")
setupLog.Error(err, "unable to create controller", "controller", "Broker")
os.Exit(1)
}

Expand Down
Loading