-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
543 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package model | ||
|
||
import ( | ||
"sigs.k8s.io/kubebuilder/pkg/scaffold/input" | ||
) | ||
|
||
type Universe struct { | ||
Boilerplate string `json:"boilerplate,omitempty"` | ||
|
||
Resource *Resource `json:"resource,omitempty"` | ||
|
||
Files []*File `json:"files,omitempty"` | ||
} | ||
|
||
// TODO: Just use the resource type? | ||
type Resource struct { | ||
// Namespaced is true if the resource is namespaced | ||
Namespaced bool `json:"namespaces,omitempty"` | ||
|
||
// Group is the API Group. Does not contain the domain. | ||
Group string `json:"group,omitempty"` | ||
|
||
// Version is the API version - e.g. v1beta1 | ||
Version string `json:"version,omitempty"` | ||
|
||
// Kind is the API Kind. | ||
Kind string `json:"kind,omitempty"` | ||
|
||
// Plural is the plural lowercase of Kind. | ||
Plural string `json:"plural,omitempty"` | ||
|
||
// Resource is the API Resource. | ||
Resource string `json:"resource,omitempty"` | ||
|
||
// ResourcePackage is the go package of the Resource | ||
GoPackage string `json:"goPackage,omitempty"` | ||
|
||
// GroupDomain is the Group + "." + Domain for the Resource | ||
GroupDomain string `json:"groupDomain,omitempty"` | ||
} | ||
|
||
type File struct { | ||
// Type is an identifier for the class of the generator | ||
Type string `json:"type"` | ||
|
||
// Path is the file to write | ||
Path string `json:"path,omitempty"` | ||
|
||
// Contents is the generated output | ||
Contents string `json:"contents,omitempty"` | ||
|
||
// TODO: Move input.IfExistsAction into model | ||
// IfExistsAction determines what to do if the file exists | ||
IfExistsAction input.IfExistsAction `json:"ifExistsAction,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.