This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
TT 3695 - Fix Security Policy Migration #540
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
it will return SecurityPolicy spec. Signed-off-by: Burak Sekili <buraksekili@gmail.com>
… TT-3695/fix-policy-migration
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
… TT-3695/fix-policy-migration
…gies/tyk-operator into TT-3695/fix-policy-migration
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
komalsukhani
reviewed
Dec 7, 2022
…urityPolicy. Add new e2e tests cases for migration Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Controller. Signed-off-by: Burak Sekili <buraksekili@gmail.com>
komalsukhani
approved these changes
Dec 12, 2022
@buraksekili Thank you for resolving this complicated bug! It looks good to me. |
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
…gies/tyk-operator into TT-3695/fix-policy-migration
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
…ison with already-defined function. Compare previous and new ID after restoring from drifts. Remove redundant conditions in wait.For() function Signed-off-by: Burak Sekili <buraksekili@gmail.com>
komalsukhani
approved these changes
Dec 15, 2022
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Kudos, SonarCloud Quality Gate passed! |
buger
pushed a commit
that referenced
this pull request
May 22, 2024
* Add if check to understand the existence of mongo id Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update CHANGELOG Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update current CR based on existing policy Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update create method of SecurityPolicy Reconciler. So that, from now on it will return SecurityPolicy spec. Signed-off-by: Burak Sekili <buraksekili@gmail.com> * use CR's AccessRightsArray field instead of generating it Signed-off-by: Burak Sekili <buraksekili@gmail.com> * add initial e2e tests for securitypolicy controller Signed-off-by: Burak Sekili <buraksekili@gmail.com> * fix linter issue, add additional error checks for type assertions Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Add a logic to recover from unintended deletes from Dashboard for SecurityPolicy. Add new e2e tests cases for migration Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Fix issues on v3.2 Signed-off-by: Burak Sekili <buraksekili@gmail.com> * generate random name for securitypolicy Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Wait for resource is updated properly Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Add new test cases to cover different scenarios of SecurityPolicy Controller. Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Revert changes and update tests accordingly Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Fix linter issue - remove extra new line Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Use unused StatusID in comparison function. Replace duplicated comparison with already-defined function. Compare previous and new ID after restoring from drifts. Remove redundant conditions in wait.For() function Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update tests cases to prevent direct comparison between IDs Signed-off-by: Burak Sekili <buraksekili@gmail.com> * return err if Tyk fails to reload Signed-off-by: Burak Sekili <buraksekili@gmail.com> Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The migration steps described in this documentation do not work as expected. Setting the
id
field in the CR to the_id
field of the existing Policy has some issues.Related Issue
Resolves #204
https://tyktech.atlassian.net/browse/TT-3695
Motivation and Context
Once you migrate the existing policy from Dashboard to k8s, k8s state should include details of the spec that exists on Dashboard, and from now on, the source of truth must become k8s. Operator must restore subsequent changes from Dashboard in the next reconciliations.
Test Coverage For This Change
Added test cases to cover:
Screenshots (if appropriate)
Types of changes
Checklist
master
!master
branch (left side). Also, it would be best if you started your change off our latestmaster
.make manifests
make helm
gofmt -s -w .
go vet ./...
golangci-lint run