secretstore_controller.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. package controllers
  13. import (
  14. "context"
  15. "github.com/go-logr/logr"
  16. "k8s.io/apimachinery/pkg/runtime"
  17. ctrl "sigs.k8s.io/controller-runtime"
  18. "sigs.k8s.io/controller-runtime/pkg/client"
  19. externalsecretsv1alpha1 "github.com/external-secrets/external-secrets/api/v1alpha1"
  20. )
  21. // SecretStoreReconciler reconciles a SecretStore object.
  22. type SecretStoreReconciler struct {
  23. client.Client
  24. Log logr.Logger
  25. Scheme *runtime.Scheme
  26. }
  27. // +kubebuilder:rbac:groups=external-secrets.io,resources=secretstores,verbs=get;list;watch;create;update;patch;delete
  28. // +kubebuilder:rbac:groups=external-secrets.io,resources=secretstores/status,verbs=get;update;patch
  29. func (r *SecretStoreReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
  30. _ = context.Background()
  31. _ = r.Log.WithValues("secretstore", req.NamespacedName)
  32. // your logic here
  33. return ctrl.Result{}, nil
  34. }
  35. func (r *SecretStoreReconciler) SetupWithManager(mgr ctrl.Manager) error {
  36. return ctrl.NewControllerManagedBy(mgr).
  37. For(&externalsecretsv1alpha1.SecretStore{}).
  38. Complete(r)
  39. }