Skip to content

Commit

Permalink
Fix missing replace conditions method (aws-controllers-k8s#104)
Browse files Browse the repository at this point in the history
Description of changes:
Add the missing `ReplaceConditions` method introduced in aws-controllers-k8s/runtime#24 .
Fix a import path error introduced in aws-controllers-k8s#102

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
RedbackThomson authored and Nicholas Thomson committed Jun 24, 2021
1 parent 84aef69 commit 215ad51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/generate/mq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestMQ_GetOutputShapeGoType(t *testing.T) {
crd := testutil.GetCRDByName(t, g, "Broker")
require.NotNil(crd)

exp := "*svcsdkapi.CreateBrokerResponse"
exp := "*svcsdk.CreateBrokerResponse"
otype := crd.GetOutputShapeGoType(crd.Ops.Create)
assert.Equal(exp, otype)
}
4 changes: 2 additions & 2 deletions pkg/model/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (r *CRD) SetOutputCustomMethodName(
}

// GetOutputShapeGoType returns the Go type of the supplied operation's Output
// shape, renamed to use the standardized svcsdkapi alias.
// shape, renamed to use the standardized svcsdk alias.
func (r *CRD) GetOutputShapeGoType(
op *awssdkmodel.Operation,
) string {
Expand All @@ -376,7 +376,7 @@ func (r *CRD) GetOutputShapeGoType(
}
orig := op.OutputRef.GoType()
// orig will contain "*<OutputShape>" with no package specifier
return "*svcsdkapi." + orig[1:]
return "*svcsdk." + orig[1:]
}

// GetOutputWrapperFieldPath returns the JSON-Path of the output wrapper field
Expand Down
5 changes: 5 additions & 0 deletions templates/pkg/resource/resource.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ func (r *resource) Conditions() []*ackv1alpha1.Condition {
return r.ko.Status.Conditions
}

// ReplaceConditions sets the Conditions status field for the resource
func (r *resource) ReplaceConditions(conditions []*ackv1alpha1.Condition) {
r.ko.Status.Conditions = conditions
}

// SetObjectMeta sets the ObjectMeta field for the resource
func (r *resource) SetObjectMeta(meta metav1.ObjectMeta) {
r.ko.ObjectMeta = meta;
Expand Down

0 comments on commit 215ad51

Please sign in to comment.