Skip to content

Minimal addon and declarative pattern implementations for addon operators #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gopkg.lock

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

27 changes: 27 additions & 0 deletions alpha/patterns/addon/common_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package addon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is copyright missing ?


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

type CommonObject interface {
runtime.Object
metav1.Object
ComponentName() string
CommonSpec() CommonSpec
GetCommonStatus() CommonStatus
SetCommonStatus(CommonStatus)
}

type CommonSpec struct {
Version string `json:"version,omitempty"`
Channel string `json:"channel,omitempty"`
}

//go:generate go run ../../vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go -O zz_generated.deepcopy -i ./...

// +k8s:deepcopy-gen=true
type CommonStatus struct {
Healthy bool `json:"healthy,omitempty"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document what these type definition are and how are they suppose to be used.

Also, would be good to include pkg level comments which makes Godoc useful in this case. I think some content from walkthrough be used in the pkg level doc.go in this case.

Loading