* refactor: remove app destination inferrence logic
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* simplify
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* more fixes
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* more fixes
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* codegen
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix mocks
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* simplify
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* clusters all the way down
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* simplify
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* test
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* lint
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* tidy
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* be less radical
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* add lastTransitionTime to health status
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* address first feedback
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* set transition time if health status is unknown
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* extend health improvement tests
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* add apoplication controller test
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* use require for NoError
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* more extensive tests for health state changes
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* Apply suggestions from code review
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Manuel Kieweg <2939765+mkieweg@users.noreply.github.com>
* Code review suggestions
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* remove obsolete assert
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
* Change LastTransitionTime field to pointer type
Due to implementation limitations, setting LastTransitionTime at the resource level is challenging.
Converting it to a pointer type allows it to be skipped at the resource level and prevents it from appearing
in .status.resources of the Application CR. Additionally, it doesn’t provide much value or have a known
use case right now.
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Resolve rebase conflicts
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Address review comment
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* Trigger CI
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
---------
Signed-off-by: Manuel Kieweg <mail@manuelkieweg.de>
Signed-off-by: Manuel Kieweg <2939765+mkieweg@users.noreply.github.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Co-authored-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Siddhesh Ghadi <sghadi1203@gmail.com>
* fix: check for double definition
As found in #13965 (and as a follow-up to #13999), we also need to
define what happens if _both_ managedNamespaceMetadata _and_ an
Application manifest are both defined for the same namespace.
The idea here is that if that happens, we emit an
`ApplicationConditionRepeatedResourceWarning`, and set the sync status
to `Unknown`, since it's unclear what is supposed to happen.
The user will then have the option of removing one of the two
definitions.
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix: check for double definition
A simpler fix - don't add a managed namespace to the targetObjs list if
a namespace already exists in the application source.
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* test: add test cases
This adds a test case showing that an ns manifest will override
`managedNamespaceMetadata` without failing horribly (as it currently
does on `HEAD`), as well as a "standard" mNMd diff vs live.
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
---------
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix: make managed namespaces more 'prune-proof'
In the cases where someone would want to set resource tracking on a
managed namespace, or if someone would want to migrate from having a
namespace in Git to using `managedNamespaceMetadata`, we need to take
steps to ensure that the namespace does not get pruned.
In order to do that, we add the live namespace to the list of
`targetObjs` (so that it's considered a part of the source even though
it's not).
Finally, we need to also ensure that the managed namespace is not
considered `OutOfSync` (due to the same reason as above).
This is a subset of #11350, the main difference being that this commit
does not set resource tracking on its own, but can be opted into if
people choose to do so.
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* refactor: extract managed namespace check
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
---------
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.
Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* fix: retain order of revisions for multi source apps (#14108)
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: retain revision for multi source app with ref-repos
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* calculate commitSHA before quitting manifest generation
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.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>