generic_store.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 v1alpha1
  13. import (
  14. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  15. "k8s.io/apimachinery/pkg/runtime"
  16. )
  17. // +kubebuilder:object:root=false
  18. // +kubebuilder:object:generate:false
  19. // +k8s:deepcopy-gen:interfaces=nil
  20. // +k8s:deepcopy-gen=nil
  21. // GenericStore is a common interface for interacting with ClusterSecretStore
  22. // or a namespaced SecretStore.
  23. type GenericStore interface {
  24. runtime.Object
  25. metav1.Object
  26. GetProvider() *SecretStoreProvider
  27. }
  28. // +kubebuilder:object:root:false
  29. // +kubebuilder:object:generate:false
  30. var _ GenericStore = &SecretStore{}
  31. // GetProvider returns the underlying provider.
  32. func (c *SecretStore) GetProvider() *SecretStoreProvider {
  33. return c.Spec.Provider
  34. }
  35. // Copy returns a DeepCopy of the Store.
  36. func (c *SecretStore) Copy() GenericStore {
  37. return c.DeepCopy()
  38. }