id
stringlengths
2
7
text
stringlengths
17
51.2k
title
stringclasses
1 value
c163900
{ res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
c163901
call args := []string{"filter", "replace", "dev", ifName, "ingress", "prio", "1", "handle", "1", "bpf", "da", "obj", objPath, "sec", progSec, } cmd = exec.CommandContext(ctx, "tc", args...).WithFilters(libbpfFixupMsg) _, err = cmd.CombinedOutput(log, true) if err != nil { return fmt.Errorf("Failed to load t...
c163902
_, err := cmd.CombinedOutput(log, true) if err != nil { return fmt.Errorf("Failed to remove tc filter: %s", err) } return nil }
c163903
:= range kr.apiKeyInt { if apiKey == kind { return true } } return false }
c163904
0, true } return *kr.apiVersionInt, false }
c163905
// leavegroup and syncgroup. switch strings.ToLower(kr.Role) { case ProduceRole: kr.apiKeyInt = KafkaRole{ProduceKey, MetadataKey, APIVersionsKey} return nil case ConsumeRole: kr.apiKeyInt = KafkaRole{FetchKey, OffsetsKey, MetadataKey, OffsetCommitKey, OffsetFetchKey, FindCoordinatorKey, JoinGroupKey, ...
c163906
*GetEndpointIDLogOK { o.Payload = payload return o }
c163907
return CiliumNetworkPolicyNodeStatus{} } return r.Status.Nodes[nodeName] }
c163908
r.Status.Nodes = map[string]CiliumNetworkPolicyNodeStatus{} } r.Status.Nodes[nodeName] = cnpns }
c163909
= map[string]CiliumNetworkPolicyNodeStatus{} } r.Status.DerivativePolicies[derivativePolicyName] = status }
c163910
} return reflect.DeepEqual(r.Spec, o.Spec) && reflect.DeepEqual(r.Specs, o.Specs) }
c163911
r.Specs != nil { for _, rule := range r.Specs { if err := rule.Sanitize(); err != nil { return nil, fmt.Errorf("Invalid CiliumNetworkPolicy specs: %s", err) } cr := k8sCiliumUtils.ParseToCiliumRule(namespace, name, uid, rule) retRules = append(retRules, cr) } } return retRules, nil }
c163912
fmt.Sprintf("%s (v2 %s)", k8sConst.CtrlPrefixPolicyStatus, name) }
c163913
return k8sCiliumUtils.GetPolicyLabels(namespace, name, uid, k8sCiliumUtils.ResourceTypeCiliumNetworkPolicy) }
c163914
for _, rule := range r.Specs { if rule.RequiresDerivative() { return true } } } return false }
c163915
{ return c[i].Name < c[j].Name }) }
c163916
} else if a[i].DestPort == a[j].DestPort { return a[i].Protocol < a[j].Protocol } } return false }) }
c163917
a[j].IPV4 { return true } else if a[i].IPV4 == a[j].IPV4 { return a[i].IPV6 < a[j].IPV6 } return false }) }
c163918
} err = (*EndpointStatus)(out).UnmarshalBinary(b) if err != nil { log.WithError(err).Error("Cannot unmarshal EndpointStatus during EndpointStatus deepcopy") return } }
c163919
options: e.Options.DeepCopy(), endpoint: e, } var err error ep.value, err = e.GetBPFValue() if err != nil { log.WithField(logfields.EndpointID, e.ID).WithError(err).Error("getBPFValue failed") return nil } return ep }
c163920
ep.endpoint.Logger(subsystem) }
c163921
accessLogPath == oldAccessLogPath { old.openCount++ log.Infof("Opened existing library instance %d, open count: %d", id, old.openCount) return id } } ins := NewInstance(nodeID, newAccessLogger(accessLogPath)) // policy client needs the instance so we set it after instance has been created ins.policyCli...
c163922
} log.Infof("CloseInstance(%d): Remaining open count: %d", id, count) } else { log.Infof("CloseInstance(%d): Not found (closed already?)", id) } return count }
c163923
New policy for %s is equal to the old one, no need to change", policyName) newMap[policyName] = oldPolicy continue } } // Validate new config if err = config.Validate(); err != nil { return fmt.Errorf("NPDS: Policy validation error for %s: %v", policyName, err) } // Create new PolicyInstance,...
c163924
return nil } return node.Host.PrimaryAddress }
c163925
{ formatNodeStatus(w, localhost, printAll, succinct, verbose, true) maxLines-- } nodes := sr.Nodes sort.Slice(nodes, func(i, j int) bool { return strings.Compare(nodes[i].Name, nodes[j].Name) < 0 }) for n, node := range nodes { if maxLines > 0 && n > maxLines { break } if node == localhost { co...
c163926
log.WithError(err).Error("Monitor failed") os.Exit(-1) } }
c163927
err := api.SetDefaultPermissions(path) if err != nil { scopedLog.WithError(err).Fatal("Cannot set default permissions on socket") } } return server }
c163928
} if err := m.validateState(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
c163929
time.Duration) *PutPolicyParams { o.SetTimeout(timeout) return o }
c163930
*PutPolicyParams { o.SetContext(ctx) return o }
c163931
o.SetHTTPClient(client) return o }
c163932
o.SetPolicy(policy) return o }
c163933
encryptKeyID: keyID, } return encryptMap.Update(k, v) }
c163934
nil { return err.Error() } return string(b) }
c163935
len(rsp.rawMsg) < 6 { return nil, fmt.Errorf("unexpected end of response (length < 6 bytes)") } return rsp, nil }
c163936
v.namespace, tweakListOptions: v.tweakListOptions} }
c163937
namespace: v.namespace, tweakListOptions: v.tweakListOptions} }
c163938
range e.endpoints { go func(eppp Endpoint) { epFunc(eppp) wg.Done() }(ep) } }
c163939
delete(e.endpoints, ep) e.mutex.Unlock() }
c163940
= struct{}{} e.mutex.Unlock() }
c163941
e.mutex.RUnlock() return len(e.endpoints) }
c163942
return fmt.Errorf("failed to rename veth from %q to %q: %s", srcIfName, dstIfName, err) } return nil }) }
c163943
:= Endpoint2IfName(id) tmpIfName := Endpoint2TempIfName(id) veth, link, err := SetupVethWithNames(lxcIfName, tmpIfName, mtu, ep) return veth, link, tmpIfName, err }
c163944
err = netlink.LinkSetMTU(peer, mtu); err != nil { return nil, nil, fmt.Errorf("unable to set MTU to %q: %s", tmpIfName, err) } hostVeth, err := netlink.LinkByName(lxcIfName) if err != nil { return nil, nil, fmt.Errorf("unable to lookup veth just created: %s", err) } if err = netlink.LinkSetMTU(hostVeth, mtu...
c163945
{ headers.Add(header.Key, header.Value) } return headers }
c163946
return "HTTP/1.1" case cilium.HttpProtocol_HTTP2: return "HTTP/2" default: return "Unknown" } }
c163947
o.SetTimeout(timeout) return o }
c163948
*GetHelloParams { o.SetContext(ctx) return o }
c163949
o.SetHTTPClient(client) return o }
c163950
return nil, Hint(err) } return resp.Payload, nil }
c163951
c.Service.GetServiceID(params) if err != nil { return nil, Hint(err) } return resp.Payload, nil }
c163952
_, created, err := c.Service.PutServiceID(params) return created != nil, Hint(err) }
c163953
err := c.Service.DeleteServiceID(params) return Hint(err) }
c163954
res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }
c163955
t := minFloat * math.Pow(factor, float64(failures)) if max != time.Duration(0) && t > maxFloat { t = maxFloat } if jitter { t = rand.Float64()*(t-minFloat) + minFloat } return time.Duration(t) }
c163956
case <-ctx.Done(): return fmt.Errorf("exponential backoff cancelled via context: %s", ctx.Err()) case <-time.After(t): } return nil }
c163957
factor := float64(2) if b.Factor != float64(0) { factor = b.Factor } t := CalculateDuration(min, b.Max, factor, b.Jitter, attempt) if b.NodeManager != nil { t = b.NodeManager.ClusterSizeDependantInterval(t) } if b.Max != time.Duration(0) && t > b.Max { t = b.Max } return t }
c163958
nil { stats = &SpanStat{} } return &templateCfg{ EndpointConfiguration: cfg, stats: stats, } }
c163959
range elfCtMapPrefixes { templateStr := bpf.LocalMapName(name, TemplateLxcID) desiredStr := bpf.LocalMapName(name, epID) result[templateStr] = desiredStr } } result[policymap.CallString(TemplateLxcID)] = policymap.CallString(epID) return result }
c163960
result |= uint16(input[1]) return result }
c163961
result |= uint32(input[1]) << 16 result |= uint32(input[2]) << 8 result |= uint32(input[3]) return result }
c163962
result["LXC_IP_4"] = sliceToBe32(ipv6[12:16]) } if ipv4 := ep.IPv4Address(); ipv4 != nil { result["LXC_IPV4"] = byteorder.HostSliceToNetwork(ipv4, reflect.Uint32).(uint32) } mac := ep.GetNodeMAC() result["NODE_MAC_1"] = sliceToBe32(mac[0:4]) result["NODE_MAC_2"] = uint32(sliceToBe16(mac[4:6])) result["LXC_ID...
c163963
{ return elfVariableSubstitutions(ep), elfMapSubstitutions(ep) }
c163964
} out := new(ControllerStatus) in.DeepCopyInto(out) return out }
c163965
if in == nil { return nil } out := new(ControllerStatusStatus) in.DeepCopyInto(out) return out }
c163966
out := new(IPAMStatus) in.DeepCopyInto(out) return out }
c163967
out := new(K8sStatus) in.DeepCopyInto(out) return out }
c163968
out := new(NodeAddressing) in.DeepCopyInto(out) return out }
c163969
out := new(NodeElement) in.DeepCopyInto(out) return out }
c163970
out := new(ProxyStatistics) in.DeepCopyInto(out) return out }
c163971
if in == nil { return nil } out := new(RequestResponseStatistics) in.DeepCopyInto(out) return out }
c163972
out := new(StatusResponse) in.DeepCopyInto(out) return out }
c163973
return NewFilteredCiliumEndpointInformer(client, namespace, resyncPeriod, indexers, nil) }
c163974
*GetMapParams { o.SetTimeout(timeout) return o }
c163975
o.SetContext(ctx) return o }
c163976
o.SetHTTPClient(client) return o }
c163977
time.Duration) *GetMetricsParams { o.SetTimeout(timeout) return o }
c163978
*GetMetricsParams { o.SetContext(ctx) return o }
c163979
o.SetHTTPClient(client) return o }
c163980
} xdsServer.AddListener(redir.listenerName, l.parserType, l.proxyPort, l.ingress, wg) return redir, nil } return nil, fmt.Errorf("%s: Envoy proxy process failed to start, cannot add redirect", l.name) }
c163981
l4 *policy.L4Filter) (revert.RevertFunc, error) { return func() error { return nil }, nil }
c163982
time.Duration) *PatchPrefilterParams { o.SetTimeout(timeout) return o }
c163983
*PatchPrefilterParams { o.SetContext(ctx) return o }
c163984
{ o.SetHTTPClient(client) return o }
c163985
*models.PrefilterSpec) *PatchPrefilterParams { o.SetPrefilterSpec(prefilterSpec) return o }
c163986
return fmt.Sprintf("Fatal error: %s", errstr) } return errstr }
c163987
cErr := C.rd_kafka_fatal_error(H.gethandle().rk, cErrstr, 512) if int(cErr) == 0 { return nil } err := newErrorFromCString(cErr, cErrstr) err.fatal = true return err }
c163988
rktpar := C.rd_kafka_topic_partition_list_add(cparts, ctopic, C.int32_t(part.Partition)) rktpar.offset = C.int64_t(part.Offset) } return cparts }
c163989
return c.SubscribeTopics([]string{topic}, rebalanceCb) }
c163990
ctopics) if e != C.RD_KAFKA_RESP_ERR_NO_ERROR { return newError(e) } c.rebalanceCb = rebalanceCb c.handle.currAppRebalanceEnable = c.rebalanceCb != nil || c.appRebalanceEnable return nil }
c163991
C.rd_kafka_unsubscribe(c.handle.rk) return nil }
c163992
defer C.rd_kafka_topic_partition_list_destroy(cparts) e := C.rd_kafka_assign(c.handle.rk, cparts) if e != C.RD_KAFKA_RESP_ERR_NO_ERROR { return newError(e) } return nil }
c163993
!= C.RD_KAFKA_RESP_ERR_NO_ERROR { return newError(e) } return nil }
c163994
C.RD_KAFKA_EVENT_OFFSET_COMMIT { panic(fmt.Sprintf("Expected OFFSET_COMMIT, got %s", C.GoString(C.rd_kafka_event_name(rkev)))) } cErr = C.rd_kafka_event_error(rkev) if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR { return nil, newErrorFromCString(cErr, C.rd_kafka_event_error_string(rkev)) } cRetoffsets := C.rd_k...
c163995
offsets := []TopicPartition{m.TopicPartition} offsets[0].Offset++ return c.commit(offsets) }
c163996
([]TopicPartition, error) { return c.commit(offsets) }
c163997
close(c.events) } C.rd_kafka_queue_destroy(c.handle.rkq) c.handle.rkq = nil e := C.rd_kafka_consumer_close(c.handle.rk) if e != C.RD_KAFKA_RESP_ERR_NO_ERROR { return newError(e) } c.handle.cleanup() C.rd_kafka_destroy(c.handle.rk) return nil }
c163998
c.rebalanceCb(c, ev) } return c.appReassigned }
c163999
default: _, term := c.handle.eventPoll(c.events, 100, 1000, termChan) if term { break out } } } c.handle.terminatedChan <- "consumerReader" return }