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

Commit

Permalink
Adding Code Generated Operator
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hein <me@christopherhein.com>
  • Loading branch information
christopherhein committed Aug 21, 2018
1 parent 794bc44 commit e70cd04
Show file tree
Hide file tree
Showing 19 changed files with 1,171 additions and 167 deletions.
1 change: 1 addition & 0 deletions pkg/apis/operator.aws/v1alpha1/s3bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type S3BucketStatus struct {

// S3BucketAdditionalResources holds the additional resources
type S3BucketAdditionalResources struct {
Services []string `json:"services"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
62 changes: 62 additions & 0 deletions pkg/apis/operator.aws/v1alpha1/snstopic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// SNSTopic defines the base resource
type SNSTopic struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
Spec SNSTopicSpec `json:"spec"`
Status SNSTopicStatus `json:"status"`
Output SNSTopicOutput `json:"output"`
AdditionalResources SNSTopicAdditionalResources `json:"additionalResources"`
}
type SNSTopicSpec struct {
CloudFormationTemplateName string `json:"cloudFormationTemplateName"`
CloudFormationTemplateNamespace string `json:"cloudFormationTemplateNamespace"`
}

// SNSTopicOutput defines the output resource for SNSTopic
type SNSTopicOutput struct {
TopicName string `json:"topicName"`
}

// SNSTopicStatus holds the status of the Cloudformation template
type SNSTopicStatus struct {
ResourceStatus string `json:"resourceStatus"`
ResourceStatusReason string `json:"resourceStatusReason"`
StackID string `json:"stackID"`
}

// SNSTopicAdditionalResources holds the additional resources
type SNSTopicAdditionalResources struct {
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// SNSTopicList defines the list attribute for the SNSTopic type
type SNSTopicList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []SNSTopic `json:"items"`
}

func init() {
localSchemeBuilder.Register(addSNSTopicTypes)
}

func addSNSTopicTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&SNSTopic{},
&SNSTopicList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
134 changes: 133 additions & 1 deletion pkg/apis/operator.aws/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e70cd04

Please sign in to comment.