Commit Graph

88 Commits

Author SHA1 Message Date
Anand Francis Joseph b3a2ec15e6
fix(sync): ApplyOutOfSyncOnly=true sync option is not honoured for cluster scoped resources (#765)
* Using live obj to get the resource key if not nil

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Fixed failing unit tests

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Added test case for validating cluster scoped resources with ApplyOutOfSyncOnly=true

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Fixed gofumpt formatting errors

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Corrected unit tests for cluster scoped resources

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Removed unwanted code comments

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Added comments for explaining the reason why ns is set from live object

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Added comments in the unit test

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

---------

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
2025-09-05 08:06:30 -04:00
Alexandre Gaudreault dab4cc0b8a
fix(hooks): always remove finalizers on create if hook exists (#770)
* fix(hooks): always remove finalizers

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

* unit test

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>

---------

Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2025-09-02 15:51:53 -04:00
Regina Voloshin 90e5e3a40e
added common disable sync otpion (#749)
Signed-off-by: reggie-k <regina.voloshin@codefresh.io>
2025-07-28 00:31:59 +03:00
Alexandre Gaudreault 8007df5f6c
fix(sync): create namespace before dry-run (#731) 2025-06-16 17:23:58 -04:00
Michael Crenshaw 8697b44eea
Revert "Add option to skip the dryrun from the sync context (#708)" (#730)
* Revert "Add option to skip the dryrun from the sync context (#708)"

This reverts commit 717b8bfd69.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* format

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2025-06-12 14:52:06 -04:00
Peter Jiang 69dfa708a6
feat: auto migrate kubectl-client-side-apply fields for SSA (#727)
* feat: auto migrate kubectl-client-side-apply fields for SSA

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* fix master version

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* run gofumpt

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* Propagate sync error instead of logging

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* allow enable/disable of CSA migration using annotation

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* fix linting

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* Refactor to allow for multiple managers and disable option

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* remove commentj

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* refactor

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* fix test

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* Add docs for client side apply migration

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* Edit comment

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

---------

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
2025-06-12 10:03:52 -04:00
Michael Crenshaw cebed7e704
chore: wrap errors (#732)
* chore: wrap errors

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* report list result along with error

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fixes

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2025-06-06 10:49:09 -04:00
Michael Crenshaw 90b69e9ae5
chore(deps): bump golangci-lint (#719)
* chore(deps): bump golangci-lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix lint

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* fix tests

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2025-05-14 17:14:57 -04:00
Pasha Kostohrys d65e9d9227
feat: Enable SkipDryRunOnMissingResource sync option on Application level (#712)
* fix: go mod tidy is not working due to k8s.io/externaljwt dependency

Signed-off-by: pasha <pasha.k@fyxt.com>

* feat: Enable SkipDryRunOnMissingResource sync option on Application level

Signed-off-by: pasha <pasha.k@fyxt.com>

* feat: Enable SkipDryRunOnMissingResource sync option on Application level

* feat: add support for skipping dry run on missing resources in sync context

- Introduced a new option to skip dry run verification for missing resources at the application level.
- Updated the sync context to include a flag for this feature.
- Enhanced tests to cover scenarios where the skip dry run annotation is applied to all resources.

---------

Signed-off-by: pasha <pasha.k@fyxt.com>
Co-authored-by: pasha <pasha.k@fyxt.com>
2025-04-20 09:41:38 +03:00
Nick Heijmink 717b8bfd69
Add option to skip the dryrun from the sync context (#708)
* Add option to skip the dryrun from the sync context

Signed-off-by: Nick Heijmink <nick.heijmink@alliander.com>

* Fix test by mocking the discovery

Signed-off-by: Nick Heijmink <nick.heijmink@alliander.com>

* Fix linting errors

Signed-off-by: Nick Heijmink <nick.heijmink@alliander.com>

* Fix skip dryrun const

---------

Signed-off-by: Nick Heijmink <nick.heijmink@alliander.com>
2025-04-10 14:12:36 -07:00
Aaron Hoffman c61756277b
feat: return images from resources when sync occurs (#642)
* Add GetResourceImages

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Use require instead of assert

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Add test for empty images case

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Rename test function to match regex

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Add support for conjobs, refactor images implementation and add test for cronjobs

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Move missing images tests to single function

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Refactor test

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Add benchmark for sync

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

* Update comment on images

Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>

---------

Signed-off-by: Aaron Hoffman <31711338+Aaron-9900@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2025-03-27 09:45:14 -04:00
Peter Jiang 7258614f50
chore: add unit test for ssa with dryRun (#703)
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
2025-03-14 12:43:14 -04:00
Peter Jiang 762f9b70f3
fix: Fix checking dryRun when using Server Side Apply (#699)
* fix: properly check dryRun flag for server side apply

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

* Remove debug logging

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>

---------

Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
2025-03-13 09:11:58 -04:00
Dejan Zele Pejchev 65db274b8d
fix: stuck hook issue when a Job resource has a ttlSecondsAfterFinished field set (#646)
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
2025-02-07 17:04:47 -05:00
Matthieu MOREL 04266647b1
chore: enable require-error from testifylint (#681)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 15:01:48 -05:00
Matthieu MOREL cc13a7d417
chore: enable gocritic (#680)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 15:00:49 -05:00
Matthieu MOREL ad846ac0fd
chore: enable increment-decrement and redundant-import-alias from revive (#679)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 14:56:44 -05:00
Matthieu MOREL c323d36706
chore: enable dot-imports, duplicated-imports from revive (#678)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 13:10:59 -05:00
Matthieu MOREL f5aa9e4d10
chore: enable perfsprint linter (#676)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 12:44:40 -05:00
Matthieu MOREL 70bee6a3a5
chore: enable early-return, indent-error-flow and unnecessary-stmt from revive (#674)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 12:43:30 -05:00
Matthieu MOREL b111e50082
chore: enable errorlint (#673)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 11:25:43 -05:00
Andrii Korotkov 3ef5ab187e
fix: New kube applier for server side diff dry run with refactoring (#662)
* fix: New kube applier for server side diff dry run with refactoring

Part of a fix for: https://github.com/argoproj/argo-cd/issues/21488

Separate logic to handle server side diff dry run applies.

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Break backwards compatibility for a better code

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Don't put applier constructor in the interface

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Address comments

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Address more comments

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable testifylint linter (#657)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable gofumpt, gosimple and whitespace linters (#666)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable use-any from revive (#667)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: bump golangci-lint to v1.63.4 and list argo-cd linters (#670)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: enable unused-parameter and var-declaration from revive (#668)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* chore: remove actions/cache duplicated behavior with actions/setup-go (#658)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Add Leo's code

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

* Make linter happy

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>

---------

Signed-off-by: Andrii Korotkov <andrii.korotkov@verkada.com>
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 11:13:38 -05:00
Matthieu MOREL bfdad63e27
chore: enable misspell linter (#672)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 11:05:44 -05:00
Matthieu MOREL ccee58366a
chore: enable unused-parameter and var-declaration from revive (#668)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-07 09:55:39 -05:00
Matthieu MOREL 7ac688a30f
chore: enable use-any from revive (#667)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-06 18:20:29 -05:00
Matthieu MOREL f948991e78
chore: enable gofumpt, gosimple and whitespace linters (#666)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-06 17:07:19 -05:00
Matthieu MOREL 382663864e
chore: enable testifylint linter (#657)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-06 10:27:22 -05:00
Pasha Kostohrys 847cfc9f8b
fix: Ability to disable Server Side Apply on individual resource level (#634)
* fix: Ability to disable Server Side Apply on individual resource level

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: Ability to disable Server Side Apply on individual resource level

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2024-11-07 16:58:28 +02:00
Alexander Matyushentsev 09e5225f84
feat: application resource deletion protection (#630)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2024-10-23 06:44:23 -07:00
Andy Goldstein adb68bcaab
fix(clusterCache): don't miss finding live obj if obj is cluster-scoped and namespacedResources is in transition (#597)
* sync.Reconcile: guard against incomplete discovery

When Reconcile performs its logic to compare the desired state (target
objects) against the actual state (live objects), it looks up each live
object based on a key comprised of data from the target object: API
group, API kind, namespace, and name. While group, kind, and name will
always be accurate, there is a chance that the value for namespace is
not. If a cluster-scoped target object has a namespace (because it
incorrectly has a namespace from its source) or the namespace parameter
passed into the Reconcile method has a non-empty value (indicating a
default value to use on namespace-scoped objects that don't have it set
in the source), AND the resInfo ResourceInfoProvider has incomplete or
missing API discovery data, the call to IsNamespacedOrUnknown will
return true when the information is unknown. This leads to the key being
incorrect - it will have a value for namespace when it shouldn't. As a
result, indexing into liveObjByKey will fail. This failure results in
the reconciliation containing incorrect data: there will be a nil entry
appended to targetObjs when there shouldn't be.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>

* Address code review comments

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>

---------

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2024-07-14 11:31:47 -04:00
sivchari 86a368824c
chore: Bump Kubernetes clients to 1.29.2 (#566)
* update k8s libs

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix: golangci-lint

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* fix nil map

Signed-off-by: sivchari <shibuuuu5@gmail.com>

* add deletion field

Signed-off-by: sivchari <shibuuuu5@gmail.com>

---------

Signed-off-by: sivchari <shibuuuu5@gmail.com>
2024-05-07 16:25:58 -04:00
Kota Kimura fbecbb86e4
feat: sync-options annotation with Force=true (#414) (#560)
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
2024-04-16 17:26:47 +03:00
Siddhesh Ghadi 5fd9f449e7
feat: Prune resources in reverse of sync wave order (#538)
* Prune resources in reverse of sync wave order

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

* Use waveOverride var instead of directly patching live obj

Directly patching live objs results into incorrect wave ordering
as the new wave value from live obj is used to perform reordering during next sync

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>

---------

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
2024-01-24 00:27:10 -05:00
Anand Francis Joseph 792124280f
fix(server): Dry run always in client mode just for yaml manifest validation even with server side apply (#564)
* Revert "feat: retry with client side dry run if server one was failed (#548)"

This reverts commit c0c2dd1f6f.

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Revert "fix(server): use server side dry run in case if it is server side apply (#546)"

This reverts commit 4a5648ee41.

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Fixed the logic to disable server side apply if it is a dry run

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Added more values in the log message for better debugging

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Fixed compilation error

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Written an inline fn to get string value of dry-run strategy

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

* Added comment as requested with reference to the issue number

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>

---------

Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
Co-authored-by: Leonardo Luz Almeida <leoluz@users.noreply.github.com>
2024-01-22 16:30:38 -05:00
Leonardo Luz Almeida aba38192fb
feat: Implement Server-Side Diffs (#522)
* feat: Implement Server-Side Diffs

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* trigger build

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* chore: remove unused function

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* make HasAnnotationOption more generic

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* add server-side-diff printer option

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* remove managedFields during server-side-diff

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* add ignore mutation webhook logic

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix configSet

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix comparison

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* merge typedconfig in typedpredictedlive

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* handle webhook diff conflicts

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix webhook normalization logic

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* address review comments 1/2

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* address review comments 2/2

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix lint

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* remove kubectl getter from cluster-cache

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix query param verifier instantiation

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* Add server-side-diff unit tests

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

---------

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
2023-12-18 14:45:13 -05:00
pasha-codefresh c0c2dd1f6f
feat: retry with client side dry run if server one was failed (#548)
* feat: retry with client side dry run if server one was failed

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: retry with client side dry run if server one was failed

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* feat: retry with client side dry run if server one was failed

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2023-11-02 11:40:24 -04:00
pasha-codefresh 4a5648ee41
fix(server): use server side dry run in case if it is server side apply (#546)
* fix: use server side dry run in case if it is server side apply

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: use server side dry run in case if it is server side apply

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
2023-10-31 10:22:05 -04:00
pasha-codefresh ed7c77a929
feat: Apply out of sync option only (#533)
Signed-off-by: pashakostohrys <pavel@codefresh.io>
2023-08-09 09:45:34 -04:00
reggie-k e56739ceba
feat: add CreateResource to kubectl (#12174 and #4116) (#516)
* separating kubectl and resource ops mocks

Signed-off-by: reggie <reginakagan@gmail.com>

* separating kubectl and resource ops mocks

Signed-off-by: reggie <reginakagan@gmail.com>

* separating kubectl and resource ops mocks

Signed-off-by: reggie <reginakagan@gmail.com>

* server dry-run for MockKubectlCmd

Signed-off-by: reggie <reginakagan@gmail.com>

* server dry-run for MockKubectlCmd

Signed-off-by: reggie <reginakagan@gmail.com>

* server dry-run for MockKubectlCmd

Signed-off-by: reggie <reginakagan@gmail.com>

* mock create noop

Signed-off-by: reggie <reginakagan@gmail.com>

* ctl create resource with createOptions

Signed-off-by: reggie <reginakagan@gmail.com>

---------

Signed-off-by: reggie <reginakagan@gmail.com>
2023-05-27 13:48:09 -04:00
Blake Pettersson ad9a694fe4
fix: do not replace namespaces (#524)
When doing `kubectl replace`, namespaces should not be affected. Fixes
argoproj/argo-cd#12810 and argoproj/argo-cd#12539.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2023-05-26 16:32:14 -07:00
Soumya Ghosh Dastidar ed70eac8b7
feat: add sync delete option (#507)
Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
2023-02-14 08:53:51 -08:00
Leonardo Luz Almeida e284fd71cb
fix: managed namespaces should not mutate the live state (#479)
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-11-08 16:05:51 -05:00
Blake Pettersson b371e3bfc5
Update namespace v2 (#465)
* Revert "Revert "feat: Ability to create custom labels for namespaces created … (#455)"

This reverts commit ce2fb703a6.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

* feat: enable namespace to be updated

Rename `WithNamespaceCreation` to `WithNamespaceModifier`, since this
method is also used for modifying existing namespaces. This method
takes a single argument for the actual updating, and unless this method
gets invoked by its caller no updating will take place (fulfilling what
the `createNamespace` argument used to do).

Within `autoCreateNamespace`, everywhere where we previously added tasks
we'll now need to check whether the namespace should be created (or
modified), which is now delegated to the `appendNsTask` and
`appendFailedNsTask` methods.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
2022-11-03 15:29:13 -04:00
pasha-codefresh ce2fb703a6
Revert "feat: Ability to create custom labels for namespaces created … (#455)
* Revert "feat: Ability to create custom labels for namespaces created with syncOptions CreateNamespace (#443)"

This reverts commit a56a803031.

* remove import

Signed-off-by: pashavictorovich <pavel@codefresh.io>

* fix test

Signed-off-by: pashavictorovich <pavel@codefresh.io>

Signed-off-by: pashavictorovich <pavel@codefresh.io>
2022-08-23 14:00:03 -04:00
Leonardo Luz Almeida 9970faba81
Cherry-Pick Retry commit in master (#452)
* fix: retry on unauthorized error when retrieving resources by gvk (#449)

* fix: retry on unauthorized when retrieving resources by gvk

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* add test case to validate retry is just invoked if error is Unauthorized

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix merge conflict

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix lint

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix lint

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-08-19 15:58:16 -04:00
pasha-codefresh a56a803031
feat: Ability to create custom labels for namespaces created with syncOptions CreateNamespace (#443)
* namespace labels hook

Signed-off-by: pashavictorovich <pavel@codefresh.io>

* add tests

Signed-off-by: pashavictorovich <pavel@codefresh.io>

* fix test

Signed-off-by: pashavictorovich <pavel@codefresh.io>

* rename import

Signed-off-by: pashavictorovich <pavel@codefresh.io>

* remove deep copy

Signed-off-by: pashavictorovich <pavel@codefresh.io>

Signed-off-by: pashavictorovich <pavel@codefresh.io>
2022-08-18 18:48:07 +02:00
jannfis 2bc3fef13e
fix: Fix argument order in resource filter (#436)
Signed-off-by: jannfis <jann@mistrust.net>
2022-08-04 21:09:09 +02:00
Leonardo Luz Almeida 1c4ef33687
feat: Add server-side apply manager config (#418)
* feat: Add server-side apply manager config

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Force conflicts when SSA

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Implement strategic-merge patch in diff

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Implement structured merge diff

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Implement structured merge in diff

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix parseable type conversion

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Handle structured merge diff for create/delete operations

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* User NormalizeUnionsApply instead of Merge for structured-merge diff

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* NormalizeUnions

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* merge first than normalize union

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* calculate diff with fieldsets

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* extract managed fields

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* remove managed fields then merge

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Just remove fields if manager is found

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* remove config fieldset instead of using managed fields

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Structure merge diff with defaults

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* tests

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Normalize union at the end

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Remove fields after merging

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* apply defaults when building diff result

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix default func call

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix diff default

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix merged object

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* keep diff order

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* apply default with patch

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* handle ssa diffs with resource annotations

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* use managed fields to calculate diff

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Implement unit tests

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix bad merge

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* add test to validate service with multiple ports

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* resolveFromStaticParser optimization

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* try without reordering while patching default values

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
2022-08-02 14:48:09 -04:00
jannfis ed31317b27
fix: Only consider resources which supports appropriate verb for any given operation (#423)
* fix: Only consider resources which supports appropriate verb for any given operation

Signed-off-by: jannfis <jann@mistrust.net>

* Fix unit tests

Signed-off-by: jannfis <jann@mistrust.net>

* Return MethodNotSupported and add some tests

Signed-off-by: jannfis <jann@mistrust.net>
2022-07-06 20:25:44 +02:00
Josh Soref 55bb49480a
chore: Spelling (#215)
* spelling: account

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: aggregation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: annotations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: argocd

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: does-not

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: donot

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: do-not

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: implementers

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: individual

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: openshift

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: relate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: requeuing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: settings

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: worse

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: youtube

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <michael@crenshaw.dev>
2022-04-12 13:35:40 -04:00