Skip to content

Commit

Permalink
Revert "Merge pull request tigera#3183 from song-jiang/enable-bpf"
Browse files Browse the repository at this point in the history
This reverts commit 38c38d8, reversing
changes made to bc08b8a.
  • Loading branch information
song-jiang committed Mar 18, 2024
1 parent d6715f2 commit caa725d
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 697 deletions.
8 changes: 0 additions & 8 deletions api/v1/installation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,14 +771,6 @@ type Installation struct {
Status InstallationStatus `json:"status,omitempty"`
}

// BPFEnabled is an extension method that returns true if the Installation resource
// has Calico Network Linux Dataplane set and equal to value "BPF" otherwise false.
func (installation *InstallationSpec) BPFEnabled() bool {
return installation.CalicoNetwork != nil &&
installation.CalicoNetwork.LinuxDataplane != nil &&
*installation.CalicoNetwork.LinuxDataplane == LinuxDataplaneBPF
}

// +kubebuilder:object:root=true

// InstallationList contains a list of Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func (r *ReconcileApplicationLayer) getTProxyMode(al *operatorv1.ApplicationLaye
// patchFelixConfiguration takes all application layer specs as arguments and patches felix config.
// If at least one of the specs requires TPROXYMode as "Enabled" it'll be patched as "Enabled" otherwise it is "Disabled".
func (r *ReconcileApplicationLayer) patchFelixConfiguration(ctx context.Context, al *operatorv1.ApplicationLayer) error {
_, err := utils.PatchFelixConfiguration(ctx, r.client, func(fc *crdv1.FelixConfiguration) (bool, error) {
_, err := utils.PatchFelixConfiguration(ctx, r.client, func(fc *crdv1.FelixConfiguration) bool {
var tproxyMode crdv1.TPROXYModeOption
if ok, v := r.getTProxyMode(al); ok {
tproxyMode = v
Expand All @@ -523,7 +523,7 @@ func (r *ReconcileApplicationLayer) patchFelixConfiguration(ctx context.Context,
//
// The felix bug was fixed in v3.16, v3.15.1 and v3.14.4; it should be safe to set new config fields
// once we know we're only upgrading from those versions and above.
return false, nil
return false
}

// If the mode is already set, fall through to the normal logic, it's safe to force-set the field now.
Expand All @@ -538,7 +538,7 @@ func (r *ReconcileApplicationLayer) patchFelixConfiguration(ctx context.Context,

// If tproxy mode is already set to desired state return false to indicate patch not needed.
if policySyncPrefixSetDesired && tproxyModeSetDesired {
return false, nil
return false
}

fc.Spec.TPROXYMode = &tproxyMode
Expand All @@ -549,7 +549,7 @@ func (r *ReconcileApplicationLayer) patchFelixConfiguration(ctx context.Context,
"policySyncPathPrefix", fc.Spec.PolicySyncPathPrefix,
"tproxyMode", string(tproxyMode),
)
return true, nil
return true
})

return err
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/egressgateway/egressgateway_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ func (r *ReconcileEgressGateway) Reconcile(ctx context.Context, request reconcil
}

// patch and get the felix configuration
fc, err := utils.PatchFelixConfiguration(ctx, r.client, func(fc *crdv1.FelixConfiguration) (bool, error) {
fc, err := utils.PatchFelixConfiguration(ctx, r.client, func(fc *crdv1.FelixConfiguration) bool {
if fc.Spec.PolicySyncPathPrefix != "" {
return false, nil // don't proceed with the patch
return false // don't proceed with the patch
}
fc.Spec.PolicySyncPathPrefix = "/var/run/nodeagent"
return true, nil // proceed with this patch
return true // proceed with this patch
})
if err != nil {
reqLogger.Error(err, "Error patching felix configuration")
Expand Down
120 changes: 0 additions & 120 deletions pkg/controller/installation/bpf.go

This file was deleted.

Loading

0 comments on commit caa725d

Please sign in to comment.