-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor RepositoryServer controller #2136
Conversation
Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Thanks for submitting this pull request 🎉. The team will review it soon and get back to you. If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document. |
pkg/controllers/repositoryserver/repositoryserver_controller.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
7a63e60
to
f3fba5f
Compare
Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -312,3 +300,23 @@ func (h *RepoServerHandler) waitForPodReady(ctx context.Context, pod *corev1.Pod | |||
} | |||
return nil | |||
} | |||
|
|||
func (h *RepoServerHandler) updateProgressInCRStatus(ctx context.Context, progress crv1alpha1.RepositoryServerProgress) error { | |||
h.Logger.Info("Fetch latest version of RepositoryServer to update the ServerInfo in its status") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move it do debug level?
if err != nil { | ||
return err | ||
} | ||
h.Logger.Info("Update the Progress") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this log. I don't think it has any significance
@@ -87,21 +87,53 @@ func (r *RepositoryServerReconciler) Reconcile(ctx context.Context, req ctrl.Req | |||
if err = r.Status().Update(ctx, repoServerHandler.RepositoryServer); err != nil { | |||
return ctrl.Result{}, err | |||
} | |||
logger.Info("Setup RepositoryServer, Create or update owned resources") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Either move it to debug or remove the logs.
Also, how do you differentiate logs of different CRs?
repoServerHandler.RepositoryServer.Status.Progress = crkanisteriov1alpha1.Ready | ||
if err = r.Status().Update(ctx, repoServerHandler.RepositoryServer); err != nil { | ||
|
||
logger.Info("Connect to Kopia Repository") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
return ctrl.Result{}, err | ||
} | ||
|
||
logger.Info("Start Repository Server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the log
return ctrl.Result{}, err | ||
} | ||
|
||
logger.Info("Add/Update users") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this logs statement
return ctrl.Result{}, err | ||
} | ||
|
||
logger.Info("Refresh Server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this logs statement
return ctrl.Result{}, err | ||
} | ||
|
||
logger.Info("Setting the CR status as 'Ready' after completing the create/update event\n\n\n\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this logs statement
if err != nil { | ||
return err | ||
} | ||
h.Logger.Info("Use this updated RepositoryServer CR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like debug logs, please remove it
This reverts commit fb4bd07.
* Update RepositoryServer CR Status fields, add metav1.conditions Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update RepositoryServer CRD Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run 'make codegen' Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix Lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor name, set ClientInitialized to ClientUserInitialized Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor RepositoryServer Controller Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * add error handling in refreshServer function Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Add function to update Progress in RepositoryServerStatus Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: kale-amruta <41624751+kale-amruta@users.noreply.github.com>
* add skeleton for validation repoitory server secrets * fix bugs * add licence headers * address review comments * change the secret type to v1.secrettype * initialize k8s client instead of all the clients since they are not required * move the consts to a secrets package so that they can be reused * move the consts to a secrets package so that they can be reused * refactor to use common constants * move the consts to a secrets package so that they can be reused * refactor to use the constants from secrets folder * address review comments * add headers * address review comments * move location key constants to secrets package * move location key constants to repositoryserver package * refactor use the constants from repositoryserver package * resolve merge conflicts * address review comments * add support for filestore secret * make lint happy * address comments * make lint happy * add licence headers * add comments on the constants * consistent error messages * Change name of constants for better readability * fix typo * simplify validation logic * change error message * remove unwanted comments * add comment in the validate repository password function * change function name for getLocationType to getLocationSecret * add nil checks for secrets * fix build issues * add empty secret checks * rename interface name to secret for readability * address review comments * address review comments * use cmd.Context * Add Cache Size Support in Templating Params in RepositoryServer (#2111) * Update param.go Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Address Comments Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Error Handling Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> --------- Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Make RepositoryServer struct consistent with RepositoryServer CRD (#2122) * Remove optional Markers, Add omitempty to fields in RepositoryServer struct as specified in repositoryserver.yaml Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix the indentation of repositoryserver CRD(repositoryserver.yaml) Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * add unit tests for repository server location credentials * make lint happy * add validation for kopia repository server controller secrets (#1940) * add skeleton for validation repoitory server secrets * fix bugs * add licence headers * address review comments * change the secret type to v1.secrettype * initialize k8s client instead of all the clients since they are not required * move the consts to a secrets package so that they can be reused * move the consts to a secrets package so that they can be reused * refactor to use common constants * move the consts to a secrets package so that they can be reused * refactor to use the constants from secrets folder * address review comments * add headers * address review comments * move location key constants to secrets package * move location key constants to repositoryserver package * refactor use the constants from repositoryserver package * resolve merge conflicts * address review comments * add support for filestore secret * make lint happy * address comments * make lint happy * add licence headers * add comments on the constants * consistent error messages * Change name of constants for better readability * fix typo * simplify validation logic * change error message * remove unwanted comments * add comment in the validate repository password function * change function name for getLocationType to getLocationSecret * add nil checks for secrets * fix build issues * add empty secret checks * rename interface name to secret for readability * address review comments * address review comments * use cmd.Context * Update MAINTAINERS.md (#2127) * support projectid in gcp provider (#2129) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * fix delete action (#2131) * Import the general client/auth package (#2134) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Fix pkg/config to use standard kubeconfig machinery (#2133) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Fix pkg/kube to use standard kubeconfig machinery (#2132) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Update ubi-minimal base image to ubi-minimal:9.2-691 (#2130) Co-authored-by: Kasten Production <infra@kasten.io> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * add tests for validating repository password and repository server admin credentials * fix tests * fix lint * fix e2e volume snapshot test (#2141) * Remove unused dirs to increase free space in GH runner (#2138) * Refactoring push_images.sh to consume a single source of truth containing valid images (#2147) * Refactoring push_images.sh to take in the single source of truth Made change * Added single source of truth file * Fixing issue with image list * Update RepositoryServer CR Status field to add `metav1.Condition` (#2135) * Update RepositoryServer CR Status fields, add metav1.conditions Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update RepositoryServer CRD Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run 'make codegen' Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix Lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor name, set ClientInitialized to ClientUserInitialized Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Add: ROADMAP.md (#2126) * Add: ROADMAP.md Signed-off-by: Mark <mlavi@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> --------- Signed-off-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Kanister docs update to version 0.93.0 (#2149) Co-authored-by: Kasten Production <infra@kasten.io> * Refactor RepositoryServer controller (#2136) * Update RepositoryServer CR Status fields, add metav1.conditions Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update RepositoryServer CRD Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run 'make codegen' Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix Lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor name, set ClientInitialized to ClientUserInitialized Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor RepositoryServer Controller Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * add error handling in refreshServer function Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Add function to update Progress in RepositoryServerStatus Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: kale-amruta <41624751+kale-amruta@users.noreply.github.com> * Revert "Refactor RepositoryServer controller (#2136)" (#2150) This reverts commit fb4bd07. * Add base unit test suite for repository server controller(#PR1) (#2100) * add base suite for repository server controller * use constants for location secret keys * make the constants local to the package * add licence headers * fix licence headers * fix lint issues * remove unused functions and move to next PR * fix build issues * move secret creation utils under test suite * add base suite for repository server controller * use constants for location secret keys * make the constants local to the package * add licence headers * fix licence headers * fix lint issues * remove unused functions and move to next PR * fix build issues * move secret creation utils under test suite * address review comments * move test utilities to pkg/testutil/testutil.go * rename kopia repository path constant name * move constants to const.go * move constants to const.go * initialize reconciler in a better way * Run PostgreSQL integration tests on 12.6.0 chart (#2156) Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com> * Adjust ref apps for OCP 4.13 (#2152) Kanister test automation config for OCP 4.13 version Co-authored-by: Vladislav Naumov <vladislav.naumov@PRG10457-MacBook-Pro.local> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * deps(go): bump google.golang.org/api from 0.120.0 to 0.130.0 (#2157) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.120.0 to 0.130.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](googleapis/google-api-go-client@v0.120.0...v0.130.0) --- updated-dependencies: - dependency-name: google.golang.org/api 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> * deps(go): bump golang.org/x/oauth2 from 0.7.0 to 0.10.0 (#2158) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.7.0 to 0.10.0. - [Commits](golang/oauth2@v0.7.0...v0.10.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 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> * remove unwanted declaration of context variable --------- Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Signed-off-by: Mark <mlavi@users.noreply.github.com> Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Rajat Gupta <37516416+r4rajat@users.noreply.github.com> Co-authored-by: Akanksha kumari <akankshakumari393@gmail.com> Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> Co-authored-by: alexy.bee <alexey.blokhin@kasten.io> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Mark Severson <mark@kasten.io> Co-authored-by: Infra Bot <63741182+infraq@users.noreply.github.com> Co-authored-by: Kasten Production <infra@kasten.io> Co-authored-by: Nishant Ravi Shankar <23146332+mellon-collie@users.noreply.github.com> Co-authored-by: Mark Lavi <5642075+mlavi@users.noreply.github.com> Co-authored-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Prasad Ghangal <prasad.ghangal@gmail.com> Co-authored-by: Vladislav Naumov <vladislav.naumov@kasten.io> Co-authored-by: Vladislav Naumov <vladislav.naumov@PRG10457-MacBook-Pro.local> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* add skeleton for validation repoitory server secrets * fix bugs * add licence headers * address review comments * change the secret type to v1.secrettype * initialize k8s client instead of all the clients since they are not required * move the consts to a secrets package so that they can be reused * move the consts to a secrets package so that they can be reused * refactor to use common constants * move the consts to a secrets package so that they can be reused * refactor to use the constants from secrets folder * address review comments * add headers * address review comments * move location key constants to secrets package * move location key constants to repositoryserver package * refactor use the constants from repositoryserver package * resolve merge conflicts * address review comments * add support for filestore secret * make lint happy * address comments * make lint happy * add licence headers * add comments on the constants * consistent error messages * Change name of constants for better readability * fix typo * simplify validation logic * change error message * remove unwanted comments * add comment in the validate repository password function * change function name for getLocationType to getLocationSecret * add nil checks for secrets * fix build issues * add empty secret checks * rename interface name to secret for readability * address review comments * address review comments * use cmd.Context * Add Cache Size Support in Templating Params in RepositoryServer (#2111) * Update param.go Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Address Comments Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Error Handling Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> --------- Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Make RepositoryServer struct consistent with RepositoryServer CRD (#2122) * Remove optional Markers, Add omitempty to fields in RepositoryServer struct as specified in repositoryserver.yaml Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix the indentation of repositoryserver CRD(repositoryserver.yaml) Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * add unit tests for repository server location credentials * make lint happy * add validation for kopia repository server controller secrets (#1940) * add skeleton for validation repoitory server secrets * fix bugs * add licence headers * address review comments * change the secret type to v1.secrettype * initialize k8s client instead of all the clients since they are not required * move the consts to a secrets package so that they can be reused * move the consts to a secrets package so that they can be reused * refactor to use common constants * move the consts to a secrets package so that they can be reused * refactor to use the constants from secrets folder * address review comments * add headers * address review comments * move location key constants to secrets package * move location key constants to repositoryserver package * refactor use the constants from repositoryserver package * resolve merge conflicts * address review comments * add support for filestore secret * make lint happy * address comments * make lint happy * add licence headers * add comments on the constants * consistent error messages * Change name of constants for better readability * fix typo * simplify validation logic * change error message * remove unwanted comments * add comment in the validate repository password function * change function name for getLocationType to getLocationSecret * add nil checks for secrets * fix build issues * add empty secret checks * rename interface name to secret for readability * address review comments * address review comments * use cmd.Context * Update MAINTAINERS.md (#2127) * support projectid in gcp provider (#2129) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * fix delete action (#2131) * Import the general client/auth package (#2134) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Fix pkg/config to use standard kubeconfig machinery (#2133) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Fix pkg/kube to use standard kubeconfig machinery (#2132) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Update ubi-minimal base image to ubi-minimal:9.2-691 (#2130) Co-authored-by: Kasten Production <infra@kasten.io> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * add tests for validating repository password and repository server admin credentials * fix tests * fix lint * fix e2e volume snapshot test (#2141) * Remove unused dirs to increase free space in GH runner (#2138) * Refactoring push_images.sh to consume a single source of truth containing valid images (#2147) * Refactoring push_images.sh to take in the single source of truth Made change * Added single source of truth file * Fixing issue with image list * Update RepositoryServer CR Status field to add `metav1.Condition` (#2135) * Update RepositoryServer CR Status fields, add metav1.conditions Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update RepositoryServer CRD Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run 'make codegen' Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix Lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor name, set ClientInitialized to ClientUserInitialized Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Add: ROADMAP.md (#2126) * Add: ROADMAP.md Signed-off-by: Mark <mlavi@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> --------- Signed-off-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Kanister docs update to version 0.93.0 (#2149) Co-authored-by: Kasten Production <infra@kasten.io> * Refactor RepositoryServer controller (#2136) * Update RepositoryServer CR Status fields, add metav1.conditions Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update RepositoryServer CRD Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run 'make codegen' Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix Lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor name, set ClientInitialized to ClientUserInitialized Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor RepositoryServer Controller Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * add error handling in refreshServer function Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Add function to update Progress in RepositoryServerStatus Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: kale-amruta <41624751+kale-amruta@users.noreply.github.com> * Revert "Refactor RepositoryServer controller (#2136)" (#2150) This reverts commit fb4bd07. * Add base unit test suite for repository server controller(#PR1) (#2100) * add base suite for repository server controller * use constants for location secret keys * make the constants local to the package * add licence headers * fix licence headers * fix lint issues * remove unused functions and move to next PR * fix build issues * move secret creation utils under test suite * add base suite for repository server controller * use constants for location secret keys * make the constants local to the package * add licence headers * fix licence headers * fix lint issues * remove unused functions and move to next PR * fix build issues * move secret creation utils under test suite * address review comments * move test utilities to pkg/testutil/testutil.go * rename kopia repository path constant name * move constants to const.go * move constants to const.go * initialize reconciler in a better way * Run PostgreSQL integration tests on 12.6.0 chart (#2156) Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com> * Adjust ref apps for OCP 4.13 (#2152) Kanister test automation config for OCP 4.13 version Co-authored-by: Vladislav Naumov <vladislav.naumov@PRG10457-MacBook-Pro.local> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * deps(go): bump google.golang.org/api from 0.120.0 to 0.130.0 (#2157) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.120.0 to 0.130.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](googleapis/google-api-go-client@v0.120.0...v0.130.0) --- updated-dependencies: - dependency-name: google.golang.org/api 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> * deps(go): bump golang.org/x/oauth2 from 0.7.0 to 0.10.0 (#2158) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.7.0 to 0.10.0. - [Commits](golang/oauth2@v0.7.0...v0.10.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 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> * remove unwanted declaration of context variable --------- Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Signed-off-by: Mark <mlavi@users.noreply.github.com> Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Rajat Gupta <37516416+r4rajat@users.noreply.github.com> Co-authored-by: Akanksha kumari <akankshakumari393@gmail.com> Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> Co-authored-by: alexy.bee <alexey.blokhin@kasten.io> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Mark Severson <mark@kasten.io> Co-authored-by: Infra Bot <63741182+infraq@users.noreply.github.com> Co-authored-by: Kasten Production <infra@kasten.io> Co-authored-by: Nishant Ravi Shankar <23146332+mellon-collie@users.noreply.github.com> Co-authored-by: Mark Lavi <5642075+mlavi@users.noreply.github.com> Co-authored-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Prasad Ghangal <prasad.ghangal@gmail.com> Co-authored-by: Vladislav Naumov <vladislav.naumov@kasten.io> Co-authored-by: Vladislav Naumov <vladislav.naumov@PRG10457-MacBook-Pro.local> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* add skeleton for validation repoitory server secrets * fix bugs * add licence headers * address review comments * change the secret type to v1.secrettype * initialize k8s client instead of all the clients since they are not required * move the consts to a secrets package so that they can be reused * move the consts to a secrets package so that they can be reused * refactor to use common constants * move the consts to a secrets package so that they can be reused * refactor to use the constants from secrets folder * address review comments * add headers * address review comments * move location key constants to secrets package * move location key constants to repositoryserver package * refactor use the constants from repositoryserver package * resolve merge conflicts * address review comments * add support for filestore secret * make lint happy * address comments * make lint happy * add licence headers * add comments on the constants * consistent error messages * Change name of constants for better readability * fix typo * simplify validation logic * change error message * remove unwanted comments * add comment in the validate repository password function * change function name for getLocationType to getLocationSecret * add nil checks for secrets * fix build issues * add empty secret checks * rename interface name to secret for readability * address review comments * address review comments * use cmd.Context * Add Cache Size Support in Templating Params in RepositoryServer (#2111) * Update param.go Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Address Comments Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Error Handling Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> --------- Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> * Make RepositoryServer struct consistent with RepositoryServer CRD (#2122) * Remove optional Markers, Add omitempty to fields in RepositoryServer struct as specified in repositoryserver.yaml Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix the indentation of repositoryserver CRD(repositoryserver.yaml) Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * add unit tests for repository server location credentials * make lint happy * add validation for kopia repository server controller secrets (#1940) * add skeleton for validation repoitory server secrets * fix bugs * add licence headers * address review comments * change the secret type to v1.secrettype * initialize k8s client instead of all the clients since they are not required * move the consts to a secrets package so that they can be reused * move the consts to a secrets package so that they can be reused * refactor to use common constants * move the consts to a secrets package so that they can be reused * refactor to use the constants from secrets folder * address review comments * add headers * address review comments * move location key constants to secrets package * move location key constants to repositoryserver package * refactor use the constants from repositoryserver package * resolve merge conflicts * address review comments * add support for filestore secret * make lint happy * address comments * make lint happy * add licence headers * add comments on the constants * consistent error messages * Change name of constants for better readability * fix typo * simplify validation logic * change error message * remove unwanted comments * add comment in the validate repository password function * change function name for getLocationType to getLocationSecret * add nil checks for secrets * fix build issues * add empty secret checks * rename interface name to secret for readability * address review comments * address review comments * use cmd.Context * Update MAINTAINERS.md (#2127) * support projectid in gcp provider (#2129) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * fix delete action (#2131) * Import the general client/auth package (#2134) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Fix pkg/config to use standard kubeconfig machinery (#2133) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Fix pkg/kube to use standard kubeconfig machinery (#2132) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Update ubi-minimal base image to ubi-minimal:9.2-691 (#2130) Co-authored-by: Kasten Production <infra@kasten.io> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * add tests for validating repository password and repository server admin credentials * fix tests * fix lint * fix e2e volume snapshot test (#2141) * Remove unused dirs to increase free space in GH runner (#2138) * Refactoring push_images.sh to consume a single source of truth containing valid images (#2147) * Refactoring push_images.sh to take in the single source of truth Made change * Added single source of truth file * Fixing issue with image list * Update RepositoryServer CR Status field to add `metav1.Condition` (#2135) * Update RepositoryServer CR Status fields, add metav1.conditions Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update RepositoryServer CRD Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run 'make codegen' Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix Lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor name, set ClientInitialized to ClientUserInitialized Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Add: ROADMAP.md (#2126) * Add: ROADMAP.md Signed-off-by: Mark <mlavi@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> * Update ROADMAP.md Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> --------- Signed-off-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Kanister docs update to version 0.93.0 (#2149) Co-authored-by: Kasten Production <infra@kasten.io> * Refactor RepositoryServer controller (#2136) * Update RepositoryServer CR Status fields, add metav1.conditions Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update RepositoryServer CRD Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run 'make codegen' Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix Lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor name, set ClientInitialized to ClientUserInitialized Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor RepositoryServer Controller Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * add error handling in refreshServer function Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Add function to update Progress in RepositoryServerStatus Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: kale-amruta <41624751+kale-amruta@users.noreply.github.com> * Revert "Refactor RepositoryServer controller (#2136)" (#2150) This reverts commit fb4bd07. * Add base unit test suite for repository server controller(#PR1) (#2100) * add base suite for repository server controller * use constants for location secret keys * make the constants local to the package * add licence headers * fix licence headers * fix lint issues * remove unused functions and move to next PR * fix build issues * move secret creation utils under test suite * add base suite for repository server controller * use constants for location secret keys * make the constants local to the package * add licence headers * fix licence headers * fix lint issues * remove unused functions and move to next PR * fix build issues * move secret creation utils under test suite * address review comments * move test utilities to pkg/testutil/testutil.go * rename kopia repository path constant name * move constants to const.go * move constants to const.go * initialize reconciler in a better way * Run PostgreSQL integration tests on 12.6.0 chart (#2156) Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com> * Adjust ref apps for OCP 4.13 (#2152) Kanister test automation config for OCP 4.13 version Co-authored-by: Vladislav Naumov <vladislav.naumov@PRG10457-MacBook-Pro.local> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * deps(go): bump google.golang.org/api from 0.120.0 to 0.130.0 (#2157) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.120.0 to 0.130.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](googleapis/google-api-go-client@v0.120.0...v0.130.0) --- updated-dependencies: - dependency-name: google.golang.org/api 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> * deps(go): bump golang.org/x/oauth2 from 0.7.0 to 0.10.0 (#2158) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.7.0 to 0.10.0. - [Commits](golang/oauth2@v0.7.0...v0.10.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 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> * remove unwanted declaration of context variable --------- Signed-off-by: Rajat Gupta <rajat.gupta@veeam.com> Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Signed-off-by: Mark <mlavi@users.noreply.github.com> Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Rajat Gupta <37516416+r4rajat@users.noreply.github.com> Co-authored-by: Akanksha kumari <akankshakumari393@gmail.com> Co-authored-by: Pavan Navarathna <6504783+pavannd1@users.noreply.github.com> Co-authored-by: alexy.bee <alexey.blokhin@kasten.io> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Mark Severson <mark@kasten.io> Co-authored-by: Infra Bot <63741182+infraq@users.noreply.github.com> Co-authored-by: Kasten Production <infra@kasten.io> Co-authored-by: Nishant Ravi Shankar <23146332+mellon-collie@users.noreply.github.com> Co-authored-by: Mark Lavi <5642075+mlavi@users.noreply.github.com> Co-authored-by: Mark <mlavi@users.noreply.github.com> Co-authored-by: Prasad Ghangal <prasad.ghangal@gmail.com> Co-authored-by: Vladislav Naumov <vladislav.naumov@kasten.io> Co-authored-by: Vladislav Naumov <vladislav.naumov@PRG10457-MacBook-Pro.local> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Revert "Revert "Refactor RepositoryServer controller (#2136)" (#2150)" This reverts commit 64595c9. * Remove logs from RepositoryServer Controller Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Remove logs Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Add logs and values that add name and namespace to the logger Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Address review comments Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * move kopia server setup part from reconcile function Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Address review comments Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com>
* Revert "Revert "Refactor RepositoryServer controller (#2136)" (#2150)" This reverts commit 64595c9. * Remove logs from RepositoryServer Controller Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Remove logs Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Add logs and values that add name and namespace to the logger Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Handle CR status conditions for Updating Service and pod Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Update CR status after updating condition Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * update overall status intead of progress Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Handle status condition for All stages in Reconcile function Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * handle case for Pod in crashloopbackoff state Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Remove handling for pod crashloopbackoff status Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Handle failure scenario for starting Repo proxy server Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Handle failure scenario for server refresh Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor reconcile function Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * typo in using err variable Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Run gofmt Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Fix lint Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Refactor code that were not aligned due to rebase Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Remove Event handling changes Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Remmove Error handling for RefreshServer and StartRepoProxyServer Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Remmove unnecessary log statement Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Set condition to nil on every reconcilition run Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Address review comments Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Address review comments Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Add ConsitionStatus struct Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> * Address review comments Remove ConditionStatus Struct and its usage Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> --------- Signed-off-by: Akanksha Kumari <akankshakumari393@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Change Overview
This PR refactors RepositoryServerController code and split that into multiple stages.
Pull request type
Please check the type of change your PR introduces:
Issues
Test Plan