Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit e70cd04

Browse files
Adding Code Generated Operator
Signed-off-by: Christopher Hein <[email protected]>
1 parent 794bc44 commit e70cd04

File tree

19 files changed

+1171
-167
lines changed

19 files changed

+1171
-167
lines changed

pkg/apis/operator.aws/v1alpha1/s3bucket.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type S3BucketStatus struct {
4949

5050
// S3BucketAdditionalResources holds the additional resources
5151
type S3BucketAdditionalResources struct {
52+
Services []string `json:"services"`
5253
}
5354

5455
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package v1alpha1
2+
3+
import (
4+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
"k8s.io/apimachinery/pkg/runtime"
6+
)
7+
8+
// +genclient
9+
// +genclient:noStatus
10+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
11+
12+
// SNSTopic defines the base resource
13+
type SNSTopic struct {
14+
metav1.TypeMeta `json:",inline"`
15+
metav1.ObjectMeta `json:"metadata"`
16+
Spec SNSTopicSpec `json:"spec"`
17+
Status SNSTopicStatus `json:"status"`
18+
Output SNSTopicOutput `json:"output"`
19+
AdditionalResources SNSTopicAdditionalResources `json:"additionalResources"`
20+
}
21+
type SNSTopicSpec struct {
22+
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
23+
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
24+
}
25+
26+
// SNSTopicOutput defines the output resource for SNSTopic
27+
type SNSTopicOutput struct {
28+
TopicName string `json:"topicName"`
29+
}
30+
31+
// SNSTopicStatus holds the status of the Cloudformation template
32+
type SNSTopicStatus struct {
33+
ResourceStatus string `json:"resourceStatus"`
34+
ResourceStatusReason string `json:"resourceStatusReason"`
35+
StackID string `json:"stackID"`
36+
}
37+
38+
// SNSTopicAdditionalResources holds the additional resources
39+
type SNSTopicAdditionalResources struct {
40+
}
41+
42+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
43+
44+
// SNSTopicList defines the list attribute for the SNSTopic type
45+
type SNSTopicList struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ListMeta `json:"metadata"`
48+
Items []SNSTopic `json:"items"`
49+
}
50+
51+
func init() {
52+
localSchemeBuilder.Register(addSNSTopicTypes)
53+
}
54+
55+
func addSNSTopicTypes(scheme *runtime.Scheme) error {
56+
scheme.AddKnownTypes(SchemeGroupVersion,
57+
&SNSTopic{},
58+
&SNSTopicList{},
59+
)
60+
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
61+
return nil
62+
}

pkg/apis/operator.aws/v1alpha1/zz_generated.deepcopy.go

Lines changed: 133 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/versioned/typed/operator.aws/v1alpha1/fake/fake_operator.aws_client.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/versioned/typed/operator.aws/v1alpha1/fake/fake_snstopic.go

Lines changed: 128 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/versioned/typed/operator.aws/v1alpha1/generated_expansion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/versioned/typed/operator.aws/v1alpha1/operator.aws_client.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)