register.go 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. Copyright © 2025 ESO Maintainer Team
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. https://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package v1alpha1
  14. import (
  15. "reflect"
  16. "k8s.io/apimachinery/pkg/runtime/schema"
  17. "sigs.k8s.io/controller-runtime/pkg/scheme"
  18. )
  19. // Package type metadata.
  20. const (
  21. Group = "external-secrets.io"
  22. Version = "v1alpha1"
  23. )
  24. var (
  25. // SchemeGroupVersion is group version used to register these objects.
  26. SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
  27. // SchemeBuilder is used to add go types to the GroupVersionKind scheme.
  28. SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
  29. // AddToScheme adds the types in this group-version to the given scheme.
  30. AddToScheme = SchemeBuilder.AddToScheme
  31. )
  32. var (
  33. // PushSecretKind is the kind name used for PushSecret resources.
  34. PushSecretKind = reflect.TypeOf(PushSecret{}).Name()
  35. // PushSecretGroupKind is the group/kind used for PushSecret resources.
  36. PushSecretGroupKind = schema.GroupKind{Group: Group, Kind: PushSecretKind}.String()
  37. // PushSecretKindAPIVersion is the kind/apiVersion used for PushSecret resources.
  38. PushSecretKindAPIVersion = PushSecretKind + "." + SchemeGroupVersion.String()
  39. // PushSecretGroupVersionKind is the GroupVersionKind for PushSecret resources.
  40. PushSecretGroupVersionKind = SchemeGroupVersion.WithKind(PushSecretKind)
  41. )
  42. var (
  43. // ClusterPushSecretKind is the kind name used for ClusterPushSecret resources.
  44. ClusterPushSecretKind = reflect.TypeOf(ClusterPushSecret{}).Name()
  45. // ClusterPushSecretGroupKind is the group/kind used for ClusterPushSecret resources.
  46. ClusterPushSecretGroupKind = schema.GroupKind{Group: Group, Kind: ClusterPushSecretKind}.String()
  47. // ClusterPushSecretKindAPIVersion is the kind/apiVersion used for ClusterPushSecret resources.
  48. ClusterPushSecretKindAPIVersion = ClusterPushSecretKind + "." + SchemeGroupVersion.String()
  49. // ClusterPushSecretGroupVersionKind is the GroupVersionKind for ClusterPushSecret resources.
  50. ClusterPushSecretGroupVersionKind = SchemeGroupVersion.WithKind(ClusterPushSecretKind)
  51. )
  52. func init() {
  53. SchemeBuilder.Register(&PushSecret{}, &PushSecretList{})
  54. SchemeBuilder.Register(&ClusterPushSecret{}, &ClusterPushSecretList{})
  55. }