Skip to content

Commit cf8f94f

Browse files
authored
Revert "Add code generation for type comparison" (#71)
Related to aws-controllers-k8s/community#757 Description of changes: - Reverts #65 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent e4f3cda commit cf8f94f

File tree

4 files changed

+0
-479
lines changed

4 files changed

+0
-479
lines changed

pkg/generate/ack/controller.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ var (
9696
"GoCodeCompare": func(r *ackmodel.CRD, deltaVarName string, sourceVarName string, targetVarName string, indentLevel int) string {
9797
return code.CompareResource(r.Config(), r, deltaVarName, sourceVarName, targetVarName, indentLevel)
9898
},
99-
"GoCodeIsEqual": func(typeDef *ackmodel.TypeDef, sourceVarName string, targetVarName string, indentLevel int) string {
100-
return code.IsEqualTypeDef(typeDef, sourceVarName, targetVarName, indentLevel)
101-
},
10299
"Empty": func(subject string) bool {
103100
return strings.TrimSpace(subject) == ""
104101
},
@@ -172,20 +169,6 @@ func Controller(
172169
return nil, err
173170
}
174171

175-
typeDefs, err := g.GetTypeDefs()
176-
if err != nil {
177-
return nil, err
178-
}
179-
equalVars := templateCompareVars{
180-
metaVars,
181-
typeDefs,
182-
}
183-
184-
// Next add the template for pkg/compare/struct.go file
185-
if err = ts.Add("pkg/compare/struct.go", "pkg/compare/struct.go.tpl", equalVars); err != nil {
186-
return nil, err
187-
}
188-
189172
// Next add the template for pkg/version/version.go file
190173
if err = ts.Add("pkg/version/version.go", "pkg/version/version.go.tpl", nil); err != nil {
191174
return nil, err
@@ -220,10 +203,3 @@ type templateCmdVars struct {
220203
templateset.MetaVars
221204
SnakeCasedCRDNames []string
222205
}
223-
224-
// templateCompareVars contains template variables for the template that outputs Go
225-
// code for equality/comparison helper functions.
226-
type templateCompareVars struct {
227-
templateset.MetaVars
228-
TypeDefs []*ackmodel.TypeDef
229-
}

pkg/generate/code/equal.go

Lines changed: 0 additions & 263 deletions
This file was deleted.

0 commit comments

Comments
 (0)