id
stringlengths
2
7
text
stringlengths
17
51.2k
title
stringclasses
1 value
c8100
c.httpGet(url, &obj) if err != nil { log.Debugf("Error getting aciGw %+v. Err: %v", keyStr, err) return nil, err } return &obj, nil }
c8101
obj) if err != nil { log.Debugf("Error creating appProfile %+v. Err: %v", obj, err) return err } return nil }
c8102
{ log.Debugf("Error getting appProfiles. Err: %v", err) return nil, err } return &objList, nil }
c8103
err != nil { log.Debugf("Error creating Bgp %+v. Err: %v", obj, err) return err } return nil }
c8104
log.Debugf("Error getting Bgps. Err: %v", err) return nil, err } return &objList, nil }
c8105
c.httpGet(url, &obj) if err != nil { log.Debugf("Error getting Bgp %+v. Err: %v", keyStr, err) return nil, err } return &obj, nil }
c8106
!= nil { log.Debugf("Error deleting Bgp %s. Err: %v", keyStr, err) return err } return nil }
c8107
c.httpGet(url, &obj) if err != nil { log.Debugf("Error getting endpoint %+v. Err: %v", keyStr, err) return nil, err } return &obj, nil }
c8108
if err != nil { log.Debugf("Error creating endpointGroup %+v. Err: %v", obj, err) return err } return nil }
c8109
err != nil { log.Debugf("Error getting endpointGroups. Err: %v", err) return nil, err } return &objList, nil }
c8110
c.httpPost(url, obj) if err != nil { log.Debugf("Error creating extContractsGroup %+v. Err: %v", obj, err) return err } return nil }
c8111
err != nil { log.Debugf("Error getting extContractsGroups. Err: %v", err) return nil, err } return &objList, nil }
c8112
err != nil { log.Debugf("Error creating global %+v. Err: %v", obj, err) return err } return nil }
c8113
log.Debugf("Error getting globals. Err: %v", err) return nil, err } return &objList, nil }
c8114
if err != nil { log.Debugf("Error creating netprofile %+v. Err: %v", obj, err) return err } return nil }
c8115
{ log.Debugf("Error getting netprofiles. Err: %v", err) return nil, err } return &objList, nil }
c8116
if err != nil { log.Debugf("Error creating network %+v. Err: %v", obj, err) return err } return nil }
c8117
log.Debugf("Error getting networks. Err: %v", err) return nil, err } return &objList, nil }
c8118
if err != nil { log.Debugf("Error creating policy %+v. Err: %v", obj, err) return err } return nil }
c8119
log.Debugf("Error getting policys. Err: %v", err) return nil, err } return &objList, nil }
c8120
:= c.httpPost(url, obj) if err != nil { log.Debugf("Error creating rule %+v. Err: %v", obj, err) return err } return nil }
c8121
log.Debugf("Error getting rules. Err: %v", err) return nil, err } return &objList, nil }
c8122
if err != nil { log.Debugf("Error creating serviceLB %+v. Err: %v", obj, err) return err } return nil }
c8123
{ log.Debugf("Error getting serviceLBs. Err: %v", err) return nil, err } return &objList, nil }
c8124
err != nil { log.Debugf("Error creating tenant %+v. Err: %v", obj, err) return err } return nil }
c8125
log.Debugf("Error getting tenants. Err: %v", err) return nil, err } return &objList, nil }
c8126
if err != nil { log.Debugf("Error creating volume %+v. Err: %v", obj, err) return err } return nil }
c8127
log.Debugf("Error getting volumes. Err: %v", err) return nil, err } return &objList, nil }
c8128
c.httpPost(url, obj) if err != nil { log.Debugf("Error creating volumeProfile %+v. Err: %v", obj, err) return err } return nil }
c8129
err != nil { log.Debugf("Error getting volumeProfiles. Err: %v", err) return nil, err } return &objList, nil }
c8130
var obj VolumeProfile err := c.httpGet(url, &obj) if err != nil { log.Debugf("Error getting volumeProfile %+v. Err: %v", keyStr, err) return nil, err } return &obj, nil }
c8131
err := c.httpDelete(url) if err != nil { log.Debugf("Error deleting volumeProfile %s. Err: %v", keyStr, err) return err } return nil }
c8132
gStateResourceManager = &StateResourceManager{stateDriver: sd} err := gStateResourceManager.Init() if err != nil { return nil, err } return gStateResourceManager, nil }
c8133
manager has not been not created.") } return gStateResourceManager, nil }
c8134
err } if alreadyExists { return core.Errorf("Resource with id: %q already exists", id) } return rsrc.Init(rsrcCfg) }
c8135
if !alreadyExists { return core.Errorf("No resource found for description: %q and id: %q", desc, id) } rsrc.Deinit() return nil }
c8136
return core.Errorf("No resource found for description: %q and id: %q", desc, id) } rsrc.Reinit(rsrcCfg) return nil }
c8137
log.Errorf("unable to find resource %s desc %s", id, desc) return 0, "" } return rsrc.GetList() }
c8138
nil, err } if !alreadyExists { return nil, core.Errorf("No resource found for description: %q and id: %q", desc, id) } return rsrc.Allocate(reqValue) }
c8139
} if !alreadyExists { return core.Errorf("No resource found for description: %q and id: %q", desc, id) } return rsrc.Deallocate(value) }
c8140
s.StateDriver.ReadAllState(globalConfigPathPrefix, s, json.Unmarshal) }
c8141
if len(ips) > 0 { return net.ParseIP(ips[0]) } } log.Errorf("Error getting port number from %s - %v", port, err) } log.Infof("No pvt IP for port %s", portName) return nil }
c8142
uplink, _ := sw.uplinkDb.Get(uplinkID) if uplink == nil { return nil } return uplink.([]string) }
c8143
err != nil { log.Fatalf("Error initializing ofnet") return nil, err } } else if netType == "host" { err = fmt.Errorf("Explicit host-net not supported") return nil, err } // Add controller to the OVS ctrlerIP := "127.0.0.1" target := fmt.Sprintf("tcp:%s:%d", ctrlerIP, ctrlrPort) if !sw.ovsdbDriver.I...
c8144
// Wait a little for OVS switch to be deleted time.Sleep(300 * time.Millisecond) } }
c8145
Name: name1, TxQLen: 0, }, PeerName: name2, } // Create the veth pair if err := netlink.LinkAdd(veth); err != nil { log.Errorf("error creating veth pair: %v", err) return err } return nil }
c8146
err } return netlink.LinkSetMTU(iface, mtu) }
c8147
&& !skipVethPair { ovsPortName = strings.Replace(intfName, "port", "vport", 1) } else { ovsPortName = intfName } return ovsPortName }
c8148
ofnet.EndpointInfo{ PortNo: ofpPort, Dscp: dscp, } // update endpoint state in ofnet err = sw.ofnetAgent.UpdateLocalEndpoint(endpoint) if err != nil { log.Errorf("Error updating local port %s to ofnet. Err: %v", ovsPortName, err) return err } return nil }
c8149
net.ParseIP(cfgEp.IPAddress), Ipv6Addr: net.ParseIP(cfgEp.IPv6Address), EndpointGroup: cfgEp.EndpointGroupID, EndpointGroupVlan: uint16(pktTag), Dscp: dscp, } // Add the local port to ofnet if sw.ofnetAgent == nil { log.Infof("Skipping adding localport to ofnet") return nil ...
c8150
further cleanup } // Delete it from ovsdb err = sw.ovsdbDriver.DeletePort(ovsPortName) if err != nil { log.Errorf("Error deleting port %s from OVS. Err: %v", ovsPortName, err) // continue with further cleanup } // Delete the Veth pairs if required if useVethPair && !skipVethPair { // Delete a Veth pair ...
c8151
fmt.Sprintf(vxlanIfNameFmt, strings.Replace(vtepIP, ".", "", -1)) }
c8152
Get the openflow port number for the interface ofpPort, err := sw.ovsdbDriver.GetOfpPortNo(intfName) if err != nil { log.Errorf("Could not find the OVS port %s. Err: %v", intfName, err) return err } // Add info about VTEP port to ofnet if sw.ofnetAgent != nil { err = sw.ofnetAgent.AddVtepPort(ofpPort, net....
c8153
if sw.ofnetAgent != nil { err = sw.ofnetAgent.RemoveVtepPort(ofpPort, net.ParseIP(vtepIP)) if err != nil { log.Errorf("Error deleting VTEP port %s to ofnet. Err: %v", intfName, err) return err } } // ask ovsdb to delete the VTEP return sw.ovsdbDriver.DeleteVtep(intfName) }
c8154
UpdateType: ofnet.LacpUpdate, UpdateInfo: linkUpd, }, }, } err := sw.ofnetAgent.UpdateUplink(portName, portUpds) if err != nil { log.Errorf("Update uplink failed. Err: %+v", err) } return } } } }
c8155
return err } log.Infof("Removed uplink %s from ofnet", portName) isPortPresent := sw.ovsdbDriver.IsPortNamePresent(portName) if len(intfList) == 1 { isPortPresent = sw.ovsdbDriver.IsPortNamePresent(intfList[0]) } if isPortPresent { if len(intfList) == 1 { err = sw.ovsdbDriver.DeletePort(intfList...
c8156
{ log.Errorf("Could not find the OVS port %s. Err: %v", intfName, err) return "", err } // Assign an IP based on the intfnumber ipStr, macStr := netutils.PortToHostIPMAC(intfNum, network) mac, _ := net.ParseMAC(macStr) portInfo := ofnet.HostPortInfo{ PortNo: ofpPort, MacAddr: mac, IpAddr: ipStr, K...
c8157
!= nil { log.Errorf("Error deleting port %s from OVS. Err: %v", ovsPortName, err) } } if isHostNS && sw.ofnetAgent != nil { err = sw.ofnetAgent.RemoveHostPort(ofpPort) if err != nil { log.Errorf("Error deleting host port %s. Err: %v", intfName, err) return err } } return nil }
c8158
sw.ofnetAgent.RemoveMaster(&masterInfo) if err != nil { log.Errorf("Error deleting ofnet master %+v. Err: %v", masterInfo, err) return err } } return nil }
c8159
:= sw.ofnetAgent.AddBgp(routerIP, As, neighborAs, neighbor) if err != nil { log.Errorf("Error adding BGP server") return err } } return nil }
c8160
err := sw.ofnetAgent.DeleteBgp() if err != nil { log.Errorf("Error removing bgp server Err: %v", err) return err } } return nil }
c8161
return sw.ofnetAgent.AddSvcSpec(svcName, spec) } return nil }
c8162
return sw.ofnetAgent.DelSvcSpec(svcName, spec) } return nil }
c8163
sw.ofnetAgent.SvcProviderUpdate(svcName, providers) } }
c8164
log.Errorf("Error: %v", err) return nil, err } log.Debugf("stats: %+v", stats) return stats, nil }
c8165
== nil { return nil, errors.New("no ofnet agent") } return sw.ofnetAgent.InspectState() }
c8166
== nil { return nil, errors.New("no ofnet agent") } return sw.ofnetAgent.InspectBgp() }
c8167
errors.New("no ofnet agent") } return sw.ofnetAgent.GlobalConfigUpdate(cfg) }
c8168
sw.ofnetAgent.AddNameServer(ns) } }
c8169
log.Fatalf("Error %s loading the client certificates and missing auth token", err) return nil } } // Setup HTTPS client tlsCfg := &tls.Config{ RootCAs: caPool, } // Setup client cert based authentication if useClientCerts { tlsCfg.Certificates = []tls.Certificate{cert} tlsCfg.BuildNameToCertificate()...
c8170
{ return fmt.Errorf("metadata not found in podSpec") } p := &c.podCache p.labelsMutex.Lock() defer p.labelsMutex.Unlock() p.setDefaults(ns, name) meta := m.(map[string]interface{}) l, ok := meta["labels"] if ok { labels := l.(map[string]interface{}) for key, val := range labels { switch valType := v...
c8171
} c.podCache.labelsMutex.Lock() defer c.podCache.labelsMutex.Unlock() res, found := c.podCache.labels[label] if found { return res, nil } log.Infof("label %s not found in podSpec for %s.%s", label, ns, name) return "", nil }
c8172
} if weps.Object.ObjectMeta.Namespace == "kube-system" && (weps.Object.ObjectMeta.Name == "kube-scheduler" || weps.Object.ObjectMeta.Name == "kube-controller-manager") { // Ignoring these frequent updates continue } resp := EpWatchResp{opcode: weps.Type} resp.svcName = weps.Object.ObjectMeta.Na...
c8173
s.StateDriver.ReadAllState(policyRuleConfigPathPrefix, s, json.Unmarshal) }
c8174
{ return s.StateDriver.WatchAllState(policyRuleConfigPathPrefix, s, json.Unmarshal, rsps) }
c8175
ruleCfg.OfnetPolicyRule = (*ofnetRule) // Save the rule return ruleCfg.Write() }
c8176
ruleCfg.OfnetPolicyRule = (*ofnetRule) // Delete the rule return ruleCfg.Clear() }
c8177
&contivListener{ Listener: l, cond: sync.NewCond(&sync.Mutex{})} }
c8178
defer s.decrementRef() return s.Listener.Accept() }
c8179
s.cond.L.Lock() for s.refCnt > 0 { s.cond.Wait() } s.cond.L.Unlock() return nil }
c8180
c.client = &http.Client{Transport: transport} return &c }
c8181
r.StatusCode == int(403): return nil, fmt.Errorf("access denied") case r.StatusCode == int(500): info, err := ioutil.ReadAll(r.Body) if err != nil { return nil, err } err = json.Unmarshal(info, &data) if err != nil { return nil, err } return &data, fmt.Errorf("internal server error") case r.S...
c8182
return fmt.Errorf("access denied") case r.StatusCode != int(200): log.Errorf("GET Status '%s' status code %d \n", r.Status, r.StatusCode) return fmt.Errorf("%s", r.Status) } return nil }
c8183
contivModel.AddRoutes(router) // Init global state from config initGlobalConfigs(configs) // Add default tenant if it doesnt exist tenant := contivModel.FindTenant("default") if tenant == nil { log.Infof("Creating default tenant") err := contivModel.CreateTenant(&contivModel.Tenant{ Key: "default...
c8184
state") return err } global.Oper.DefaultNetwork = gOper.DefaultNetwork global.Oper.FreeVXLANsStart = int(gOper.FreeVXLANsStart) gCfg := &gstate.Cfg{} gCfg.StateDriver = stateDriver numVlans, vlansInUse := gCfg.GetVlansInUse() numVxlans, vxlansInUse := gCfg.GetVxlansInUse() global.Oper.NumNetworks = int(nu...
c8185
global.ArpMode, PvtSubnet: global.PvtSubnet, } // Create the object err = master.CreateGlobal(stateDriver, &gCfg) if err != nil { log.Errorf("Error creating global config {%+v}. Err: %v", global, err) return err } return nil }
c8186
if numVlans+numVxlans > 0 { return errExistingNetworks("forwarding mode") } if global.FwdMode == "routing" { //check if any bgp configurations exists. bgpCfgs := &mastercfg.CfgBgpState{} bgpCfgs.StateDriver = stateDriver cfgs, _ := bgpCfgs.ReadAll() if len(cfgs) != 0 { log.Errorf("Unable to c...
c8187
Delete global state err = master.DeleteGlobal(stateDriver) if err != nil { log.Errorf("Error deleting global config. Err: %v", err) return err } return nil }
c8188
if profCount != 0 { log.Warnf("AciGwCreate: %d existing App-Profiles found.", profCount) } return nil }
c8189
aci.EnforcePolicies = params.EnforcePolicies aci.IncludeCommonTenant = params.IncludeCommonTenant aci.NodeBindings = params.NodeBindings aci.PathBindings = params.PathBindings aci.PhysicalDomain = params.PhysicalDomain return nil }
c8190
profiles exist profCount := contivModel.GetAppProfileCount() if profCount != 0 { return core.Errorf("%d App-Profiles found. Delete them first", profCount) } return nil }
c8191
= contivModel.GetAppProfileCount() return nil }
c8192
err := epgObj.Write() if err != nil { log.Errorf("Error updating epg state(%+v). Err: %v", epgObj, err) return err } } // Setup links modeldb.AddLink(&prof.Links.Tenant, tenant) modeldb.AddLinkSet(&tenant.LinkSets.AppProfiles, prof) err := tenant.Write() if err != nil { log.Errorf("Error updating t...
c8193
newProf.AppProfileName) epgObj := contivModel.FindEndpointGroup(epgKey) if epgObj == nil { return core.Errorf("EndpointGroup %s not found", epgKey) } modeldb.RemoveLink(&epgObj.Links.AppProfile, oldProf) err := epgObj.Write() if err != nil { log.Errorf("Error updating epg state(%+v). Err: %v"...
c8194
continue } modeldb.RemoveLink(&epgObj.Links.AppProfile, prof) err := epgObj.Write() if err != nil { log.Errorf("Error updating epg state(%+v). Err: %v", epgObj, err) } } modeldb.RemoveLinkSet(&tenant.LinkSets.AppProfiles, prof) tenant.Write() return nil }
c8195
endpoint.Oper.Network = ep.NetID endpoint.Oper.EndpointID = ep.EndpointID endpoint.Oper.ServiceName = ep.ServiceName endpoint.Oper.EndpointGroupID = ep.EndpointGroupID endpoint.Oper.EndpointGroupKey = ep.EndpointGroupKey endpoint.Oper.IpAddress = []string{ep.IPAddress, ep.IPv6Address} endpoin...
c8196
err != nil && err != master.EpgPolicyExists { log.Errorf("Error detaching policy %s from epg %s", policyName, endpointGroup.Key) } // Remove links modeldb.RemoveLinkSet(&policy.LinkSets.EndpointGroups, endpointGroup) modeldb.RemoveLinkSet(&endpointGroup.LinkSets.Policies, policy) policy.Write() } // C...
c8197
epOper := contivModel.EndpointOper{} epOper.Network = ep.NetID epOper.EndpointID = ep.EndpointID epOper.ServiceName = ep.ServiceName epOper.EndpointGroupID = ep.EndpointGroupID epOper.EndpointGroupKey = ep.EndpointGroupKey epOper.IpAddress = []string{ep.IPAddress, ep.IPv6Address} epOper.Ma...
c8198
%s)", endpointGroup.TenantName, endpointGroup.GroupName, err.Error()) } // get the netprofile structure by finding the netprofile profileKey := GetNetprofileKey(endpointGroup.TenantName, endpointGroup.NetProfile) netprofile := contivModel.FindNetprofile(profileKey) if netprofile != nil { // Remove linksets...
c8199
{ return err } // Build network config networkCfg := intent.ConfigNetwork{ Name: network.NetworkName, NwType: network.NwType, PktTagType: network.Encap, PktTag: network.PktTag, SubnetCIDR: network.Subnet, Gateway: network.Gateway, IPv6SubnetCIDR: network.Ipv...