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

1695 Коммитов

Автор SHA1 Сообщение Дата
shchen ccba21e79d
Update ClusterSubnetStates crd (#1769)
put timestamp to status.
2023-02-03 10:46:00 -06:00
dependabot[bot] f9abe9ae6e
deps: bump github.com/golangci/golangci-lint from 1.50.1 to 1.51.0 in /build/tools (#1779) 2023-02-02 22:48:53 +00:00
Evan Baker c4462ebd08
Adds reference daemonset for v1 cni installer (#1771)
cut down cni installer for v1

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

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2023-02-01 23:23:18 +00:00
Camryn Lee 9dc035473b
Copy azure-vnet-telemetry and azure-vnet-ipam in test setup (#1778)
copy binaries in setup
2023-02-01 20:02:22 +00:00
dependabot[bot] e8d91c9e77
deps: bump google.golang.org/grpc from 1.50.1 to 1.52.0 (#1761) 2023-01-25 00:21:17 +00:00
Evan Baker 7432bf4b1f
parameterize dependency versions in dropgz and update azcni (#1714)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2023-01-24 11:44:40 -08:00
dependabot[bot] c41243f9dd
deps: bump github.com/spf13/cobra from 1.5.0 to 1.6.1 in /dropgz (#1678) 2023-01-23 22:38:08 +00:00
dependabot[bot] 93497a5542
deps: bump github.com/labstack/echo/v4 from 4.9.0 to 4.10.0 (#1737) 2023-01-20 19:40:11 +00:00
dependabot[bot] cea7ba95fc
deps: bump github.com/containernetworking/plugins from 1.1.1 to 1.2.0 in /azure-ipam (#1762)
deps: bump github.com/containernetworking/plugins in /azure-ipam

Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](https://github.com/containernetworking/plugins/compare/v1.1.1...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/containernetworking/plugins
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-19 17:11:41 -06:00
shchen ddb5954351
nmagent get nv version list api V2 refactor (#1744)
* tmp commit for onbaording nma v2

* Remove test output file

* Remove unnecessary code when CNS onboard get nc version list without
token

* tmp commit to fix getnc version tests when onboarding nc version api v2
from nmagent.

* Fix the unit test for nmagent v2 api change.

* Fix unit test TestGetNetworkContainerVersionStatus

* Revert back to GetNCVersionF test.

* Roll back to get nc version api v1 for test.

* Continue revert back and store nc version url

* Onboard nmagent get nc version api v2.

* Address pr feedback of returning early and remove comment out code.

* Remove unnecessary ncVersionURLs and NCVersionRequest.

* Remove unnecessary variables.

* Update nmagent get nc version api v2 to v2 url

* Remove comment out code.

* tmp commit for onbaording nma v2

* Remove test output file

* Remove unnecessary code when CNS onboard get nc version list without
token

* tmp commit to fix getnc version tests when onboarding nc version api v2
from nmagent.

* Fix the unit test for nmagent v2 api change.

* Fix unit test TestGetNetworkContainerVersionStatus

* Revert back to GetNCVersionF test.

* Roll back to get nc version api v1 for test.

* Continue revert back and store nc version url

* Onboard nmagent get nc version api v2.

* Address pr feedback of returning early and remove comment out code.

* Remove unnecessary ncVersionURLs and NCVersionRequest.

* Remove unnecessary variables.

* Update nmagent get nc version api v2 to v2 url

* Remove comment out code.

* Update nmagent get nc version list.

* Address feedback and fix golint

* Fix lint issue.

* Fix the remaining 2 lint issues.

* Revert back test error generation to address feedback.
2023-01-19 17:10:23 -06:00
Hunter Gregory bd299fe727
fix: [NPM-WIN] ignore irrelevant errors from ipsetmanager (#1741)
* ignore certain errors

* remove changes to updatePod tracking (on/off-node)
2023-01-19 09:45:39 -08:00
Hunter Gregory 3e5915f802
perf: [NPM-WIN] only track updatepods on-node (#1743)
only track updatepods on-node
2023-01-19 09:44:24 -08:00
Hunter Gregory 8bbb99e2d9
fix: [NPM] add NetworkPolicy validation for matchExpression values (#1717)
* add validation for matchExpression values

* fix lint

* make regex identical to kubectl validation and include more test cases

* remove debugging lines
2023-01-19 09:43:55 -08:00
Timothy J. Raymond 45108ae514
Fix incorrect HTTP status from publish NC (#1757)
* Fix incorrect HTTP status from publish NC

CNS was responding with an HTTP status code of "0" from NMAgent.
Successes are supposed to be 200. The C-style var block at the beginning
of publishNetworkContainer was the reason for this. During refactoring,
the location where this status code was set to a successful value of 200
was accidentally removed. Because the var block declared the variable
and silently initialized it to 0, the compiler did not flag this bug as
it otherwise would have. The status code has been removed from this
block and explicitly defined and initialized to a correct value of 200.
Subsequent error handling will change this as necessary.

Also, despite consumers depending on this status, there were no tests to
verify that the status was set correctly. Tests have been added to
reflect this dependency.

* Ensure that NMAgent body is always set

DNC depends on the NMAgent body being set for its vestigial functions of
retrying failed requests. Since failed requests will now be retried
internally (to CNS) by the NMAgent client, this isn't really necessary
anymore. There are versions of DNC out there that depend on this body
though, so it needs to be present in order for NC publishing to actually
work.

* Fix missing NMAgent status for Unpublish

It was discovered that the Unpublish endpoints also omitted the status
codes and bodies expected by clients. This adds those and fixes the
associated tests to guarantee the expected behavior.

* Silence the linter

There were two instances where the linter was flagging dynamic errors,
but this is just in a test. It's perfectly fine to bend the rules there,
since we don't expect to re-use the errors (they really should be
t.Fatal / t.Error anyway, but due to legacy we're returning errors here
instead).
2023-01-19 04:17:46 +00:00
Evan Baker bcbb60561a
update cilium version to fix pipelines (#1763)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2023-01-19 00:26:59 +00:00
Hunter Gregory 702196639a
test: [NPM-LINUX] update linux conformance binary (#1748)
* update linux conformance binary

* temporarily comment out test profiles until one works

* Revert "temporarily comment out test profiles until one works"

This reverts commit db623d3833.

* undo change to git checkout for windows
2023-01-17 11:40:27 -08:00
dependabot[bot] e783f6437b
deps: bump github.com/spf13/cobra from 1.6.0 to 1.6.1 (#1759) 2023-01-12 21:40:42 +00:00
dependabot[bot] 67af2135d1
deps: bump go.uber.org/zap from 1.23.0 to 1.24.0 in /azure-ipam (#1711) 2023-01-11 20:30:47 +00:00
dependabot[bot] e981347d7b
deps: bump github.com/spf13/viper from 1.12.0 to 1.14.0 (#1753) 2023-01-11 18:37:03 +00:00
ZetaoZhuang 063fe58a41
refactor and move the nmagentConfig code from cns to namgent package. (#1723)
* refactor and move the nmagentConfig code from cns to namgent package.
2023-01-10 23:00:03 -08:00
dependabot[bot] e86c188d46
deps: bump sigs.k8s.io/controller-runtime from 0.12.3 to 0.14.1 (#1749) 2023-01-11 00:37:46 +00:00
dependabot[bot] 9f29a1b6ff
deps: bump go.uber.org/zap from 1.23.0 to 1.24.0 in /dropgz (#1710) 2023-01-10 02:28:09 +00:00
dependabot[bot] 09933ea906
deps: bump go.uber.org/zap from 1.23.0 to 1.24.0 in /zapai (#1709) 2023-01-09 21:48:07 +00:00
Paul Johnston 4e5530cc65
Fix broken NC publishing due to type mismatch (#1740) 2023-01-09 19:46:05 +00:00
Behzad Mirkhanzadeh 7b647be285
fix: repair windows cni lock issue (#1712)
* Moving the lock from InitializeKeyValueStore() function to restore/save functions to improve cni performance on windows.

* fix: use defer function to unlock statefile.

* fix: fixing the IPAM lock and defer func

* fix: Optimizing cni file lock by moving SetSdnRemoteArpMacAddress() on startup for CRD and MultitenantCRD mode.

* adding store lock on telemetry service start to avoid race condition on windows.
2023-01-07 08:03:09 +00:00
shchen abd0772432
Updated aks-engine to unblock the pipeline. (#1745)
* Updated aks-engine to unblock the pipeline.

* Use the latest aks-e dependancy.

* Update aks-e dependency to unblock acn pipeline and set retry to 0 to
get quick result.
2023-01-06 17:50:26 -06:00
dependabot[bot] b5f4fbf580
deps: bump sigs.k8s.io/controller-tools from 0.10.0 to 0.11.1 in /build/tools (#1733)
* deps: bump sigs.k8s.io/controller-tools in /build/tools

Bumps [sigs.k8s.io/controller-tools](https://github.com/kubernetes-sigs/controller-tools) from 0.10.0 to 0.11.1.
- [Release notes](https://github.com/kubernetes-sigs/controller-tools/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-tools/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/controller-tools/compare/v0.10.0...v0.11.1)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* regen crds

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

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
2023-01-05 14:55:12 -06:00
aegal 376d03bcbc
Revert linux e2e removal (#1731)
Co-authored-by: estebancams <101819268+estebancams@users.noreply.github.com>
Co-authored-by: Camryn Lee <31013536+camrynl@users.noreply.github.com>
2023-01-04 13:54:38 -08:00
estebancams 26dd052a62
remove windows 2004 aks-e tests from pipeline (#1736)
* feat: remove windos 2004 aks-e tests from pipeline

* fix: dependency on cleanup stage

Co-authored-by: Esteban Capillo <estebancams@microsoft.com>
2023-01-04 10:32:22 -06:00
Paul Johnston 633a976afe
Enable auto updates for windows aks-engine clusters (#1732)
Address s360 items with auto-updates on aks-engine windows clusters
2022-12-30 19:18:12 +00:00
Paul Johnston 3979c46c73
Image name and tag print in makefile (#1734) 2022-12-22 21:03:53 +00:00
Paul Johnston dbfa8f0520
Network name as an optional variable (#1730)
* Network name as an optional variable
2022-12-20 10:41:34 -08:00
Timothy J. Raymond 53fb51067c
Fix incorrect empty body provided to Wireserver (#1728)
In cases where clients using a WireserverTransport (namely the NMAgent
one) do not wish to provide a body, one must be provided to satisfy
quirks of Wireserver. Initially, an empty Go string was thought to be
sufficient, but this is not. Wireserver expects an empty JSON string:
specifically the 2-byte sequence "".

Furthermore, this logic was only being triggered on cases where a nil
body was presented to the WireserverTransport's logic. Given that there
are now more linters enforcing the use of `http.NoBody`, this is
distinct from `nil` and must be separately checked for (but treated in
the same way).

Tests and inline documentation have been updated to reflect this new
understanding.

* Add Content-Type for outgoing Wireserver POSTs

Because the Body of the request was replaced, Go also has no idea what
the content type should be. It can't read from the reader to perform the
detection, so this just sets it to JSON manually. As mentioned in the
comments, this is a good idea anyway since we're being explicit rather
than relying on heuristic methods to do the right thing.
2022-12-16 14:10:33 -08:00
Hunter Gregory 1f1aacf8af
log: [NPM] warn instead of error on invalid Pod IPs (#1718)
warn instead of error on invalid Pod IPs
2022-12-14 09:55:38 -08:00
Vamsi Kalapala 8cd63a8d0d
fix: [NPM-Win] Get local endpoints for updatepod, but all endpoints for cleanup. (#1606)
* fix: [NPM-WIN] Get only local endpoints to apply ACLs on

* addding a const

* fix lints

* update UTs (TODO: uncomment multi-job test when fixed)

* resolve lint again

* true backwards compatibility

* resolve TODO by uncommenting UT

* fix lint

Co-authored-by: Hunter Gregory <hunterlgregory@gmail.com>
2022-12-12 16:07:12 -08:00
ZetaoZhuang e6eadd3379
feat: expose getHomeAzInfo api in cns to retrieve node home az infos from NMAgent (#1642) 2022-12-08 08:23:41 -08:00
Evan Baker 353b7e01c6
fix: cns to use controller runtime (cached) clients in reconcilers (#1668)
* update crd clients to accept existing ctrlcli core clients

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

* fix cns to use managed cached clients for reconcilers

Signed-off-by: GitHub <noreply@github.com>

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Signed-off-by: GitHub <noreply@github.com>
2022-12-05 17:55:45 -08:00
Evan Baker d9786753f2
add v1 conflist to dropgz (#1701)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-12-01 13:14:42 -08:00
Evan Baker b939dbfb26
fix variable ordering in hackfile (#1697)
fix variable ordering

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

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-12-01 09:47:23 -08:00
Timothy J. Raymond 57120ca41f
Fix failure to start CNS when setting WireserverIP (#1707)
There was insufficient coverage over cases involving different
permutations of the "WireserverIP" configuration option. Consequently,
there were instances where reasonable values for this option caused CNS
to fail to start.

This moves the logic for transforming the CNS configuration into
configuration suitable for the NMAgent client into a method off the
CNSConfig. It also permits adding coverage over different scenarios that
are likely to emerge.
2022-11-30 20:09:53 +00:00
Matthew Long 7b91752d10
feat: cns writes cni conflist (#1702)
* feat: add cni conflist generator for v4 overlay scenario

* feat: use atomic fs operations

* fix: use same directory as temp dir since /tmp is a tmpfs
2022-11-29 04:56:08 +00:00
Hunter Gregory 8cc8e7f1ff
fix: [NPM-LINUX] resiliency for several non-retriable errors (#1566)
* adaptively modify linux max restore try count to prevent perpetual errors

* remove debug print

* log restore file and send ipsetmanager_linux errors

* send other appropriate errors

* fix handleLineError function

* fix printing restore lines and enhance a log

* fix lints and wrap chainLineNumber errors

* fix one off error for logging the try count

* revert exponential increase to try limit

* update try count to 5 and update UTs

* do not log lines for every restore call until perf is understood
2022-11-23 10:38:21 -08:00
estebancams ef1bff6046
Migrate powershell docker scripts to docker@2 (#1666)
* feat: migrate powershell docker scripts to docker@2

* feat: added retry to docker task

* fix: added repo info for image push step

* fix: added missing parameters for windows template parents

* fix: removed debugging lines

Co-authored-by: Esteban Capillo <estebancams@microsoft.com>
2022-11-17 10:14:45 -06:00
Evan Baker 3a5c72b079
fix: hide echo banner in log (#1669)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
2022-11-16 23:13:08 +00:00
Camryn Lee b0efb9c94d
cancel pipeline on tag change (#1661)
* test repo trigger

* add resources label

* add repositories under resources

* test with endpoint

* testing with tag check

* typo in condition line

* evaulate version in condition

* compare tag vars

* test cancellation stage

* add job to cancel stage

* change name of cancel stage

* add pool and msg to cancel job

* change cancellation dependency

* add second tag validation stage

* spcaing ofvalidation1

* test ne and cancellation script

* check tag versions

* set currentTagx variable

* test new tag var

* fix value mapping

* check_tag job

* update current tag in manifest stage

* reading tags

* adjust variable assignment

* uncomment sleep

* read out different tags

* test validation dependency

* use succeeded/failed in condition check

* fix condition

* fix call to succeeded()

* omit condition on validation stages to read tags

* remove sleep, just validate condition

* fix error with submod swift naming
2022-11-14 22:36:59 +00:00
Evan Baker d2f74832c8
Revert "skip podtocidr(1.1.1.1:80) tests in cilium connectivity tests" (#1700)
Revert "skip podtocidr(1.1.1.1:80) tests in cilium connectivity tests (#1698)"

This reverts commit 39b6a33e6b.
2022-11-13 16:29:47 -06:00
Camryn Lee 0c5c12af38
Add Cilium on AKS Overlay e2e scenario (#1609)
* add hack overlay make target and e2e templates

* update pipeline.yaml with new overlay stage

* use dropgz/overlay-byocni in acn pr and submodule pipeline

* name overlay clusters for submodule pipeline

* modify dropgz setup

* test ipam + overlay

* use azilium conflist

* add overlay configmap

* add deployment of ip-masq-agent to cluster

* set flag in ip-masq-agent deployment

* update deployment

* configmap creation
2022-11-12 18:03:17 +00:00
Camryn Lee 39b6a33e6b
skip podtocidr(1.1.1.1:80) tests in cilium connectivity tests (#1698)
* skip failing pod-to-cidr tests

* fix skip command
2022-11-11 14:55:37 -06:00
Timothy J. Raymond 31a0906102
Fix inability to unmarshal nmagent request (#1695)
* Fix inability to unmarshal nmagent request

During the previous switchover to using the client from the
`nmagent` client (as opposed to the `cns/nmagent` client), an assumption
was made that "proxied" requests to NMAgent were provided by clients as
nested JSON. This assumption was wrong--they are Base64-encoded strings
of JSON. Even though they're ultimately similar, they're very different
from the perspective of the JSON unmarshaler. Consequently, this
restores the nested request body back to a []byte and performs the
second-stage decoding manually (similarly to how it was previously
done).

Fixes #1694

* Fix swallowed error when body is not JSON

In one instance, an error was accidentally swallowed because the
existing code does not return errors (it sets variables instead). This
makes controlling the flow of execution difficult. To fix this, the
offending code has been moved to a separate function where returns can
be used effectively.
2022-11-10 18:22:17 -06:00
Hunter Gregory 3c08f86d71
fix: [WIN-NPM] don't apply policy to new pod with same IP as an old pod (#1569)
* don't apply policy to IP's old pod owner

* fix podkey/ip check

* test case for pod key check

* clarify error message

* fix windows lint and have complete UT coverage of isIPAffiliated

* comment out flaky UT for now
2022-11-10 09:49:55 -08:00