Skip to content

Commit

Permalink
Merge pull request #232 from maisem/strategy
Browse files Browse the repository at this point in the history
Fix issue with the strategy tag not being respected.
  • Loading branch information
Phillip Wittrock authored Mar 28, 2018
2 parents e9f2476 + 811f98d commit e809ac2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/apiregister-gen/generators/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ func (b *APIsBuilder) ParseIndex() {

r.Strategy = rt.Strategy

// If not defined, default the strategy to the group strategy for backwards compatibility
// If not defined, default the strategy to the {{.Kind}}Strategy for backwards compatibility
if len(r.Strategy) == 0 {
r.Strategy = fmt.Sprintf("%s.%sStrategy", r.Group, r.Kind)
r.Strategy = fmt.Sprintf("%sStrategy", r.Kind)
}

// Copy the Status strategy to mirror the non-status strategy
Expand Down
4 changes: 2 additions & 2 deletions cmd/apiregister-gen/generators/unversioned_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ type {{ $s.Name }} struct {
// {{.Kind}} Functions and Structs
//
// +k8s:deepcopy-gen=false
type {{.Kind}}Strategy struct {
type {{.Strategy}} struct {
builders.DefaultStorageStrategy
}
// +k8s:deepcopy-gen=false
type {{$api.Kind}}StatusStrategy struct {
type {{.StatusStrategy}} struct {
builders.DefaultStatusStorageStrategy
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/apiregister-gen/generators/versioned_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ type {{.Kind}}SchemeFns struct {
}
// +k8s:deepcopy-gen=false
type {{.Kind}}Strategy struct {
type {{.Strategy}} struct {
builders.DefaultStorageStrategy
}
// +k8s:deepcopy-gen=false
type {{$api.Kind}}StatusStrategy struct {
type {{.StatusStrategy}} struct {
builders.DefaultStatusStorageStrategy
}
Expand Down

0 comments on commit e809ac2

Please sign in to comment.