Skip to content

Commit 2e0a6ef

Browse files
committed
convert to multi-api
1 parent 6ac4860 commit 2e0a6ef

25 files changed

+260
-92
lines changed

PROJECT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
domain: io
2+
multigroup: true
23
repo: github.com/external-secrets/external-secrets
34
resources:
45
- group: external-secrets

api/v1alpha1/groupversion_info.go

Lines changed: 0 additions & 42 deletions
This file was deleted.

apis/doc.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
*/
14+
15+
//
16+
// +domain=external-secrets.io
17+
18+
package apis

apis/externalsecrets/doc.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
*/
14+
15+
// +groupName=external-secrets.io
16+
17+
package externalsecrets

api/v1alpha1/meta_types.go renamed to apis/externalsecrets/v1alpha1/doc.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ See the License for the specific language governing permissions and
1212
limitations under the License.
1313
*/
1414

15+
// Package v1alpha1 contains resources for external-secrets
16+
// +kubebuilder:object:generate=true
17+
// +groupName=external-secrets.io
18+
// +versionName=v1alpha1
1519
package v1alpha1
16-
17-
// Refers to a Secret in Kubernetes.
18-
type SecretKeySelector struct {
19-
Name string `json:"name"`
20-
Key string `json:"key"`
21-
22-
// +optional
23-
Namespace *string `json:"namespace,omitempty"`
24-
}

api/v1alpha1/externalsecret_types.go renamed to apis/externalsecrets/v1alpha1/externalsecret_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,3 @@ type ExternalSecretList struct {
191191
metav1.ListMeta `json:"metadata,omitempty"`
192192
Items []ExternalSecret `json:"items"`
193193
}
194-
195-
func init() {
196-
SchemeBuilder.Register(&ExternalSecret{}, &ExternalSecretList{})
197-
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
*/
14+
15+
package v1alpha1
16+
17+
import (
18+
"reflect"
19+
20+
"k8s.io/apimachinery/pkg/runtime/schema"
21+
"sigs.k8s.io/controller-runtime/pkg/scheme"
22+
)
23+
24+
// Package type metadata.
25+
const (
26+
Group = "external-secrets.io"
27+
Version = "v1alpha1"
28+
)
29+
30+
var (
31+
// SchemeGroupVersion is group version used to register these objects.
32+
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
33+
34+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
35+
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
36+
AddToScheme = SchemeBuilder.AddToScheme
37+
)
38+
39+
// ExternalSecret type metadata.
40+
var (
41+
ExtSecretKind = reflect.TypeOf(ExternalSecret{}).Name()
42+
ExtSecretGroupKind = schema.GroupKind{Group: Group, Kind: ExtSecretKind}.String()
43+
ExtSecretKindAPIVersion = ExtSecretKind + "." + SchemeGroupVersion.String()
44+
ExtSecretGroupVersionKind = SchemeGroupVersion.WithKind(ExtSecretKind)
45+
)
46+
47+
// SecretStore type metadata.
48+
var (
49+
SecretStoreKind = reflect.TypeOf(SecretStore{}).Name()
50+
SecretStoreGroupKind = schema.GroupKind{Group: Group, Kind: SecretStoreKind}.String()
51+
SecretStoreKindAPIVersion = SecretStoreKind + "." + SchemeGroupVersion.String()
52+
SecretStoreGroupVersionKind = SchemeGroupVersion.WithKind(SecretStoreKind)
53+
)
54+
55+
func init() {
56+
SchemeBuilder.Register(&ExternalSecret{}, &ExternalSecretList{})
57+
SchemeBuilder.Register(&SecretStore{}, &SecretStoreList{})
58+
}

api/v1alpha1/secretstore_awssm_types.go renamed to apis/externalsecrets/v1alpha1/secretstore_awssm_types.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,22 @@ limitations under the License.
1414

1515
package v1alpha1
1616

17+
import (
18+
esmeta "github.com/external-secrets/external-secrets/apis/meta/v1"
19+
)
20+
1721
type AWSSMAuth struct {
1822
SecretRef AWSSMAuthSecretRef `json:"secretRef"`
1923
}
2024

2125
type AWSSMAuthSecretRef struct {
2226
// The AccessKeyID is used for authentication
2327
// +optional
24-
AccessKeyID SecretKeySelector `json:"accessKeyIDSecretRef,omitempty"`
28+
AccessKeyID esmeta.SecretKeySelector `json:"accessKeyIDSecretRef,omitempty"`
2529

2630
// The SecretAccessKey is used for authentication
2731
// +optional
28-
SecretAccessKey SecretKeySelector `json:"secretAccessKeySecretRef,omitempty"`
32+
SecretAccessKey esmeta.SecretKeySelector `json:"secretAccessKeySecretRef,omitempty"`
2933
}
3034

3135
// Configures a store to sync secrets using the AWS Secret Manager provider.

api/v1alpha1/secretstore_types.go renamed to apis/externalsecrets/v1alpha1/secretstore_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,3 @@ type SecretStoreList struct {
105105
metav1.ListMeta `json:"metadata,omitempty"`
106106
Items []SecretStore `json:"items"`
107107
}
108-
109-
func init() {
110-
SchemeBuilder.Register(&SecretStore{}, &SecretStoreList{})
111-
}

0 commit comments

Comments
 (0)