secretstore_controller.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 secretstore
  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. esv1alpha1 "github.com/external-secrets/external-secrets/apis/externalsecrets/v1alpha1"
  20. )
  21. // Reconciler reconciles a SecretStore object.
  22. type Reconciler struct {
  23. client.Client
  24. Log logr.Logger
  25. Scheme *runtime.Scheme
  26. ControllerClass string
  27. }
  28. // +kubebuilder:rbac:groups=external-secrets.io,resources=secretstores,verbs=get;list;watch;create;update;patch;delete
  29. // +kubebuilder:rbac:groups=external-secrets.io,resources=secretstores/status,verbs=get;update;patch
  30. func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
  31. _ = context.Background()
  32. _ = r.Log.WithValues("secretstore", req.NamespacedName)
  33. // your logic here
  34. return ctrl.Result{}, nil
  35. }
  36. func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
  37. return ctrl.NewControllerManagedBy(mgr).
  38. For(&esv1alpha1.SecretStore{}).
  39. Complete(r)
  40. }