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
4 changes: 3 additions & 1 deletion internal/cluster/validation_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const (
AreMetallbRequirementsSatisfied = ValidationID(models.ClusterValidationIDMetallbRequirementsSatisfied)
IsLokiRequirementsSatisfied = ValidationID(models.ClusterValidationIDLokiRequirementsSatisfied)
IsOpenShiftLoggingRequirementsSatisfied = ValidationID(models.ClusterValidationIDOpenshiftLoggingRequirementsSatisfied)
AreNetworkObservabilityRequirementsSatisfied = ValidationID(models.ClusterValidationIDNetworkObservabilityRequirementsSatisfied)
)

func (v ValidationID) Category() (string, error) {
Expand Down Expand Up @@ -98,7 +99,8 @@ func (v ValidationID) Category() (string, error) {
AreOADPRequirementsSatisfied,
AreMetallbRequirementsSatisfied,
IsLokiRequirementsSatisfied,
IsOpenShiftLoggingRequirementsSatisfied:
IsOpenShiftLoggingRequirementsSatisfied,
AreNetworkObservabilityRequirementsSatisfied:
return "operators", nil
}
return "", common.NewApiError(http.StatusInternalServerError, errors.Errorf("Unexpected cluster validation id %s", string(v)))
Expand Down
1 change: 1 addition & 0 deletions internal/featuresupport/feature_support_level.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var featuresList = map[models.FeatureSupportLevelID]SupportLevelFeature{
models.FeatureSupportLevelIDMETALLB: (&MetalLBFeature{}).New(),
models.FeatureSupportLevelIDLOKI: (&LokiFeature{}).New(),
models.FeatureSupportLevelIDOPENSHIFTLOGGING: (&OpenShiftLoggingFeature{}).New(),
models.FeatureSupportLevelIDNETWORKOBSERVABILITY: (&NetworkObservabilityFeature{}).New(),

// Platform features
models.FeatureSupportLevelIDNUTANIXINTEGRATION: (&NutanixIntegrationFeature{}).New(),
Expand Down
35 changes: 35 additions & 0 deletions internal/featuresupport/features_olm_operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/openshift/assisted-service/internal/operators/fenceagentsremediation"
"github.com/openshift/assisted-service/internal/operators/kubedescheduler"
"github.com/openshift/assisted-service/internal/operators/loki"
"github.com/openshift/assisted-service/internal/operators/networkobservability"
"github.com/openshift/assisted-service/internal/operators/nodehealthcheck"
"github.com/openshift/assisted-service/internal/operators/nodemaintenance"
"github.com/openshift/assisted-service/internal/operators/numaresources"
Expand Down Expand Up @@ -1239,3 +1240,37 @@ func (f *MetalLBFeature) getFeatureActiveLevel(cluster *common.Cluster, _ *model
}
return activeLevelNotActive
}

// NetworkObservabilityFeature describes the support for the Network Observability Operator.
type NetworkObservabilityFeature struct{}

func (f *NetworkObservabilityFeature) New() SupportLevelFeature {
return &NetworkObservabilityFeature{}
}

func (f *NetworkObservabilityFeature) getId() models.FeatureSupportLevelID {
return models.FeatureSupportLevelIDNETWORKOBSERVABILITY
}

func (f *NetworkObservabilityFeature) GetName() string {
return networkobservability.FullName
}

func (f *NetworkObservabilityFeature) getSupportLevel(filters SupportLevelFilters) (models.SupportLevel, models.IncompatibilityReason) {
return models.SupportLevelSupported, ""
}

func (f *NetworkObservabilityFeature) getIncompatibleArchitectures(_ *string) []models.ArchitectureSupportLevelID {
return []models.ArchitectureSupportLevelID{}
}

func (f *NetworkObservabilityFeature) getIncompatibleFeatures(string) []models.FeatureSupportLevelID {
return []models.FeatureSupportLevelID{}
}

func (f *NetworkObservabilityFeature) getFeatureActiveLevel(cluster *common.Cluster, _ *models.InfraEnv, clusterUpdateParams *models.V2ClusterUpdateParams, _ *models.InfraEnvUpdateParams) featureActiveLevel {
if isOperatorActivated(networkobservability.Name, cluster, clusterUpdateParams) {
return activeLevelActive
}
return activeLevelNotActive
}
4 changes: 3 additions & 1 deletion internal/host/validation_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const (
AreMetalLBRequirementsSatisfied = validationID(models.HostValidationIDMetallbRequirementsSatisfied)
AreLokiRequirementsSatisfied = validationID(models.HostValidationIDLokiRequirementsSatisfied)
AreOpenShiftLoggingRequirementsSatisfied = validationID(models.HostValidationIDOpenshiftLoggingRequirementsSatisfied)
AreNetworkObservabilityRequirementsSatisfied = validationID(models.HostValidationIDNetworkObservabilityRequirementsSatisfied)
)

func (v validationID) category() (string, error) {
Expand Down Expand Up @@ -146,7 +147,8 @@ func (v validationID) category() (string, error) {
AreOADPRequirementsSatisfied,
AreMetalLBRequirementsSatisfied,
AreLokiRequirementsSatisfied,
AreOpenShiftLoggingRequirementsSatisfied:
AreOpenShiftLoggingRequirementsSatisfied,
AreNetworkObservabilityRequirementsSatisfied:
return "operators", nil
}
return "", common.NewApiError(http.StatusInternalServerError, errors.Errorf("Unexpected validation id %s", string(v)))
Expand Down
2 changes: 2 additions & 0 deletions internal/operators/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/openshift/assisted-service/internal/operators/mce"
"github.com/openshift/assisted-service/internal/operators/metallb"
"github.com/openshift/assisted-service/internal/operators/mtv"
"github.com/openshift/assisted-service/internal/operators/networkobservability"
"github.com/openshift/assisted-service/internal/operators/nmstate"
"github.com/openshift/assisted-service/internal/operators/nodefeaturediscovery"
"github.com/openshift/assisted-service/internal/operators/nodehealthcheck"
Expand Down Expand Up @@ -89,6 +90,7 @@ func NewManager(log logrus.FieldLogger, manifestAPI manifestsapi.ManifestsAPI, o
numaresources.NewNumaResourcesOperator(log),
oadp.NewOadpOperator(log),
metallb.NewMetalLBOperator(log),
networkobservability.NewNetworkObservabilityOperator(log),
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package networkobservability

import (
"encoding/json"
"fmt"
)

const (
Name = "network-observability"
FullName = "Network Observability Operator"
Namespace = "openshift-netobserv-operator"
SubscriptionName = "network-observability-operator"
Source = "redhat-operators"
SourceName = "netobserv-operator"
GroupName = "netobserv-operatorgroup"
)

// Config holds the configuration for Network Observability Operator
type Config struct {
// CreateFlowCollector indicates whether to create a FlowCollector resource
CreateFlowCollector bool `json:"createFlowCollector,omitempty"`
// Sampling rate for eBPF agent (default: 50)
Sampling int `json:"sampling,omitempty"`
}

// ParseProperties parses the properties JSON string into a Config struct
func ParseProperties(properties string) (*Config, error) {
config := &Config{
CreateFlowCollector: false, // Default: don't create FlowCollector
Sampling: 50, // Default sampling rate
}

if properties == "" {
return config, nil
}

if err := json.Unmarshal([]byte(properties), config); err != nil {
return nil, fmt.Errorf("failed to parse network-observability properties: %w", err)
}

// Validate sampling rate
if config.Sampling <= 0 {
return nil, fmt.Errorf("sampling rate must be positive, got %d", config.Sampling)
}

return config, nil
}
Loading