Skip to content

Commit

Permalink
endpoint: do not export ForcePolicyCompute function
Browse files Browse the repository at this point in the history
This function is only used by `pkg/endpoint` now, do not export it.

Signed-off by: Ian Vernon <ian@cilium.io>
  • Loading branch information
Ian Vernon committed Aug 20, 2019
1 parent addbe27 commit 0997b90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pkg/endpoint/api.go
Expand Up @@ -20,6 +20,9 @@ import (
"github.com/cilium/cilium/api/v1/models"
)

// ValidPatchTransitionState checks whether the state to which the provided
// model specifies is one to which an Endpoint can transition as part of a
// call to PATCH on an Endpoint.
func ValidPatchTransitionState(state models.EndpointState) bool {
switch string(state) {
case "", StateWaitingForIdentity, StateReady:
Expand Down Expand Up @@ -105,7 +108,7 @@ func (e *Endpoint) ProcessChangeRequest(epTemplate *models.EndpointChangeRequest
// Other endpoints need not be regenerated as no labels were changed.
// Note that we still need to (eventually) regenerate the endpoint for
// the changes to take effect.
e.ForcePolicyCompute()
e.forcePolicyComputation()

// Transition to waiting-to-regenerate if ready.
if e.GetStateLocked() == StateReady {
Expand Down
7 changes: 4 additions & 3 deletions pkg/endpoint/endpoint.go
Expand Up @@ -974,8 +974,9 @@ func (e *Endpoint) applyOptsLocked(opts option.OptionMap) bool {
return changed
}

// ForcePolicyCompute marks the endpoint for forced bpf regeneration.
func (e *Endpoint) ForcePolicyCompute() {
// forcePolicyComputation ensures that upon the next policy calculation for this
// Endpoint, that no short-circuiting of said operation occurs.
func (e *Endpoint) forcePolicyComputation() {
e.forcePolicyCompute = true
}

Expand Down Expand Up @@ -2092,7 +2093,7 @@ func (e *Endpoint) identityLabelsChanged(ctx context.Context, myChangeRev int) e

// Unconditionally force policy recomputation after a new identity has been
// assigned.
e.ForcePolicyCompute()
e.forcePolicyComputation()

e.Unlock()

Expand Down

0 comments on commit 0997b90

Please sign in to comment.