Граф коммитов

1339 Коммитов

Автор SHA1 Сообщение Дата
Hunter Gregory 5d8c2ae6be
lock ipsm while adding/updating netpol (#1257) 2022-02-25 12:26:50 -06:00
rsagasthya 569c946435
Subnet labels (#1238)
* 12622609: Dimensions to metrics.

* Modified the constants declaration.

* Made a slight change to make the observeIPPoolState() method inline and remove a whitespace.

* Modified label values to stay consistent with other prometheus labels.
2022-02-24 14:40:00 -08:00
Evan Baker 8f9d6b32d6
use fully-qualified image names in all Dockerfiles (#1248)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-02-24 12:08:13 -06:00
Matthew Long d8b4ce2c74
fix: CRD status should include Node IP (#1249) 2022-02-23 04:18:57 +00:00
Li Ma 4a9b6a476d
update makefile and crd generated version (#1255)
Co-authored-by: Li Ma <lima2@microsoft.com>
2022-02-22 16:07:11 -06:00
dependabot[bot] 06f91b959b
vendor: bump k8s.io/apiextensions-apiserver from 0.23.3 to 0.23.4 (#1250) 2022-02-21 21:56:46 +00:00
dependabot[bot] 3028ebdaae
vendor: bump k8s.io/client-go from 0.23.3 to 0.23.4 (#1251) 2022-02-18 20:50:56 +00:00
Hunter Gregory 9fabfe5b4e
fix: [NPM] rename string methods (#1235)
* rename string methods

* fix build error
2022-02-18 06:45:45 -08:00
Paul Johnston 81fd321fef
Allow cns to register node if no NCs are present (#1232) 2022-02-17 12:25:36 -08:00
Hunter Gregory f685e62209
wip (#1241) 2022-02-16 15:38:55 -08:00
Hunter Gregory c2c1d45ceb
feat: [NPM] v2 as default config & PlaceFirst toggle functionality for v2 (#1233)
* add placeFirst to pMgr cfg

* add placeFirst=false functionality to v2

* use constant instead of bool values for placeFirst

* fix bug and update cyclonus profiles

* set placefirst config based on configmap

* make code cleaner

* position azure jump first or directly after kube jump

* fix npm encoder ut
2022-02-16 15:37:40 -08:00
Vamsi Kalapala 39faa0bf2d
[NPM] Fanout Hydration event support in DPShim and GSP (#1242)
* [NPM] Adding support for Goal state processor Hydration event

* Adding logic in GSP to delete old cached objects

* Adding support for ForceDelete IpSet

* Adding missing event type

* Switching order of event type enum

* Addressing comments
2022-02-16 14:18:39 -08:00
Evan Baker 756a08c3d6
specify docker as container builder (#1247) 2022-02-16 12:52:56 -08:00
Evan Baker 467eacd4ea
update cyclonus workflow (#1246)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-02-16 14:30:17 -06:00
dependabot[bot] ce2bfa9acc
vendor: bump sigs.k8s.io/controller-runtime from 0.11.0 to 0.11.1 (#1245) 2022-02-16 20:09:17 +00:00
Evan Baker bbba65ab7a
update gofumpt (#1243)
Signed-off-by: GitHub <noreply@github.com>
2022-02-16 12:06:15 -06:00
Evan Baker 09c06b01e1
Parameterize Makefile, parallelize platform builds, support buildah (#1102)
* templatize the container make targets

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* add container push to npm conformance task

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* update pipelines

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* default OS and ARCH to GOOS and GOARCH

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-02-15 19:00:04 -06:00
Evan Baker a77e2475b7
Don't send NNC to Pool Monitor before Reconciler starts (#1236)
* remove early nnc send to pool monitor

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* order service starts better and add logging in initialization

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* wait for reconciler to start

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* update comments and docs

Signed-off-by: GitHub <noreply@github.com>
2022-02-15 18:50:30 -06:00
Paul Miller 7b15cbd8f2
get return codes for ipconfig at least (#1231)
* get return codes for ipconfig at least

* fix lint

* valid label name
2022-02-15 12:35:19 -06:00
Evan Baker cadca2f764
Include PendingRelease when calculating IP pool for scale-down (#1237)
* fix scale down

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* update pool state variable naming

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* add test for pending release

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-02-15 11:21:08 -06:00
Vamsi Kalapala ad516c017f
feat: [NPM] Adding DPShim layer in controller pods (#1206)
* intial touches to create sets

* adding initial touches to dpshim

* deprecating initialize DP func

* feat: [NPM] Adding DPShim layer in controller pods

* correcting an import error

* Adding some UTs

* adding a UT

* Addressing some comments

* Moving an UT to linux specifc file

* Fixing some issues with controller pod

* Adding some dns poilices and logs for debugging

* Moving aroudn outchannel to help with hydration of new clients

* removeing pass by ref

* Adding http server in daemon for pprof

* Adding a new grpc option to wait

* Fixing 100% cpu in daemon

* Fixing some logic in list management

* Applying some golints

* adding mutex

* Addressing comments and solving a bug. Cyclonus seems to be good now

* Fixing a bug

* Addressing a comment

* fixing an issue and addressing comments
2022-02-14 16:10:17 -08:00
Timothy J. Raymond 297a157bef
fix: panic caused by nil Writer provided to Logger (#1228)
* fix: panic caused by nil Writer provided to Logger

In the log.(*Logger).Init method, several different strategies are
considered based on the configuration provided by the user. In one
common case, a rotating log file is opened and the log output is tee-ed
into it. If there is any issue with opening that log file, the
`log.(*Log).SetOutput` method is never invoked on the underlying logger.
Since this standard library logger was created with `nil` passed as the
`io.Writer`, this results in a nil pointer deref panic. The error
causing the issue is also not surfaced to the user.

This initializes the standard library logger with the `io.Discard`
writer. This adheres to the original intention here, while also being a
safer alternative to nil (effectively writes are to /dev/null). Also,
the error is written out to stderr, in the hopes that an operator will
be able to diagnose and fix the issue (in the absense of a correct
logger configuration).

Finally, the logger initialization has been moved to a new
function, `log.NewLoggerE` that properly exposes the underlying error.
The original function, `NewLogger`, has been modified to use this
function instead and has been marked Deprecated.

* Remove redundant types in function signatures

The linter correctly pointed out that the types are redundant here.
While ordinarily I tend to leave them if the ellision appears in the
middle of the signature, I respect the linter's decision :)

* Change NewLoggerE test to use TempDir

Rather than trying to pull a non-existant path out of thin air and
hoping that it doesn't exist, this instead uses os.TempDir to create a
guaranteed-empty directory. From within the newly-created tempdir we try
to use a non-existent path. This is better both on a single platform,
but also has the benefit of working well on Windows too.

* Fix test to use os.MkdirTemp instead of os.TempDir

The intention of this test was to create a new temporary directory
rather than use the system's temporary directory. This mistake was
pointed out by @rbtr in a code review (thanks!).

* Fix nil logger under error conditions

When an error is present, we want to return both the error and the
logger to guarantee that a usable logger is always present. This returns
the logger in all circumstances and documents that fact in the godoc for
this function.
2022-02-10 16:01:53 -05:00
Hunter Gregory 1ea2f5a745
feat: [NPM] num ACL rules for v2 & update existing metrics (#1223)
* wip

* fix windows build err

* address comments

* fix lingering merge conflicts
2022-02-09 20:38:46 -08:00
Hunter Gregory c820189a2f
feat: [NPM] send more AI logs (#1230)
* send heartbeat log and send logs in v2

* address comment and add logs for ip validation and policy manager bootup
2022-02-09 15:28:05 -08:00
Hunter Gregory d5f134d597
feat: [NPM] perf metrics for pod/ns/policy CRUD (#1220)
* add dataplane health metrics

* change counters to countervecs

* wip

* uncomment metrics.ReinitializeAll()

* add comment about ReinitializeAll

* restructure prometheus-metrics.go, address comments, and finish UTs for v1

* properly record exec times and include error labels

* add error label to add_policy_exec_time

* add v2 UTs, test NoOp, and address comment

* resolve lints
2022-02-09 15:27:35 -08:00
Evan Baker 6631ba2db9
update stale parameters and include PR messages (#1229)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-02-09 12:30:37 -06:00
dependabot[bot] cfaeb12e34
vendor: bump go.uber.org/zap from 1.20.0 to 1.21.0 (#1226) 2022-02-08 22:11:04 +00:00
Paul Johnston 3421003a89
Mellanox priority vlan tag set script (#1224) 2022-02-07 13:31:03 -08:00
Nitish Malhotra d3aeda737e
feat: [NPM] Restructure code and add deploy manifests (#1203) 2022-02-04 16:25:12 -08:00
Matthew Long 580c3e4072
feat: don't use CNS for CNI DEL command in windows multitenancy (#1216)
* feat: don't use CNS for CNI DEL command in windows multitenancy

* go fmt

* go fmt take 2

* fix: don't fallback to CNS for getNetwork or deleteHostNCApipaEndpoint, handle errNetworkNotFound

* test: add test for FindNetworkIDFromNetNs

* fix: getNetworkName needs to fallback to CNS when not found in state file for ADD

* fix: simplify the deleteHostNCApipaEndpoint function

* fix: linter

* fix: cnm should compile

* fix: always return retriable error for endpoint deletion failure

* fix: handle npe in cns/hnsclient by not using that package

* fix: logging

* fix: don't try cns if there is no multitenancy client

* fix: don't call CNS twice during ADD cmd

* fix: use hns wrapper, add some logging, don't return error when endpoint is already deleted
2022-02-03 19:14:31 -08:00
dependabot[bot] 494308df4e
vendor: bump k8s.io/apiextensions-apiserver from 0.23.0 to 0.23.3 (#1221) 2022-02-04 02:40:45 +00:00
Evan Baker d13d13c9d1
update tooling (#1217)
* update infra

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

* add stale action

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-02-03 10:01:51 -08:00
dependabot[bot] 487b0a4d7d
vendor: bump k8s.io/client-go from 0.23.0 to 0.23.3 (#1212) 2022-02-03 08:24:30 +00:00
dependabot[bot] 4986bb6988
vendor: bump k8s.io/klog/v2 from 2.30.0 to 2.40.1 (#1213) 2022-02-03 04:45:16 +00:00
aegal d52ed96a20
guard against unstructured url forwarding in CNS API's (#1192)
* remove forwarding unstructured urls

* remove forwarding unstructured urls

* addressing feedback

* fix linting issues

* update getncversion test

* fix test issue where nmagent handler returns 500

* update for linter

* address comments

* small liniter changes

* quick linting changes

* lint

* use gofumpt instead of gofmt

* ignore line count
2022-02-01 15:13:44 -08:00
Hunter Gregory 667743d79f
fix: [NPM] fix incorrect ipset create, fix 1-off prometheus logic, and add cache checking for UTs (#1202)
* wip

* dont touch v1 metrics code and fix lints

* add comment and comment code to resolve lint

* optimize looping and dirty cache updates

* address comments and change param type of modifyCacheForKernelMemberUpdate to reduce map lookups

* add exec time metrics

* UTs

* fix lints

* initialize metrics in policymanager tests

* fix bug in publishing npm logs
2022-02-01 14:47:20 -08:00
dependabot[bot] 24c41bd551
vendor: bump github.com/prometheus/client_golang from 1.11.0 to 1.12.1 (#1215) 2022-02-01 19:59:20 +00:00
dependabot[bot] 39cd7c0aee
vendor: bump github.com/billgraziano/dpapi from 0.3.0 to 0.4.0 (#1182) 2022-02-01 04:55:35 +00:00
dependabot[bot] 082510448a
vendor: bump github.com/google/go-cmp from 0.5.6 to 0.5.7 (#1214) 2022-02-01 04:54:34 +00:00
dependabot[bot] b42e8458cc
vendor: bump go.uber.org/zap from 1.19.1 to 1.20.0 (#1211) 2022-01-31 23:22:11 +00:00
Evan Baker 427a1e4200
fix initialize from kube pods flow (#1194)
* fix initialize from kube pods flow

Signed-off-by: Evan Baker <rbtr@users.noreply.github.

* move list pods inside closure

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-01-31 14:57:55 -08:00
Vamsi Kalapala efdd2817ef
fix: [NPM] reduce log noise for reconcile periodic task (#1209)
* fix: [NPM] reduce log noise for reconcile periodic task

* removing info logs in pod controller

* more info logs removed
2022-01-31 13:10:13 -08:00
dependabot[bot] 50a10c1d4c
vendor: bump github.com/spf13/viper from 1.9.0 to 1.10.1 (#1179) 2022-01-29 02:57:02 +00:00
Evan Baker 80e574b036
match on Node controller ref in NNC event predicate (#1190)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-01-28 17:37:20 -08:00
Evan Baker ee60d13daa
codeql (#1143) 2022-01-28 14:21:56 -08:00
dependabot[bot] a47c7c45a3
vendor: bump github.com/hashicorp/go-version from 1.3.0 to 1.4.0 (#1210) 2022-01-28 02:41:12 +00:00
dependabot[bot] 4b3f096145
vendor: bump google.golang.org/grpc from 1.40.0 to 1.44.0 (#1208)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.40.0 to 1.44.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.40.0...v1.44.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-27 15:38:00 -08:00
dependabot[bot] 726b7e4f30
vendor: bump github.com/spf13/cobra from 1.2.1 to 1.3.0 (#1180) 2022-01-27 22:21:04 +00:00
Hunter Gregory 9d8e61e7ae
feat: [NPM] Forward Compatibility: delete v2 chains in v1, and Restructure Code (#1200)
* delete v2 chains in v1 and move code around

* leave v1 the same, and add v2 chains to the list to flush/destroy

* update go mod and package name

* Revert "update go mod and package name"

This reverts commit 46b674c440.

* rename folder

* address comments

* remove extra ioutil import statement

* update mod/vendoring

* Revert "update mod/vendoring"

This reverts commit 436897e6cb.

* back to original go.mod

* update build tags for ioutil files used in v1
2022-01-27 12:36:50 -08:00
dependabot[bot] 35dcb32b18
vendor: bump sigs.k8s.io/controller-runtime from 0.9.5 to 0.11.0 (#1174) 2022-01-27 02:57:39 +00:00