Skip to content

Commit cf45416

Browse files
authored
bring in ACK runtime v0.8.0 (#142)
Removes the unused AWSResourceDescriptor.UpdateCRStatus that was removed in ACK runtime v0.8.0 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent ad665fe commit cf45416

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GO111MODULE=on
66
AWS_SERVICE=$(shell echo $(SERVICE) | tr '[:upper:]' '[:lower:]')
77

88
# Build ldflags
9-
VERSION ?= "v0.7.0"
9+
VERSION ?= "v0.8.0"
1010
GITCOMMIT=$(shell git rev-parse HEAD)
1111
BUILDDATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
1212
IMPORT_PATH=github.com/aws-controllers-k8s/code-generator

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/code-generator
33
go 1.14
44

55
require (
6-
github.com/aws-controllers-k8s/runtime v0.7.0
6+
github.com/aws-controllers-k8s/runtime v0.8.0
77
github.com/aws/aws-sdk-go v1.37.4
88
github.com/dlclark/regexp2 v1.4.0
99
// pin to v0.1.1 due to release problem with v0.1.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
6767
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
6868
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
6969
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
70-
github.com/aws-controllers-k8s/runtime v0.7.0 h1:A+55gZVCXiO9EUlCz8MCcquMrcyPYzMLUXdpfOiOUDc=
71-
github.com/aws-controllers-k8s/runtime v0.7.0/go.mod h1:xA2F18PJerBHaqrS4de1lpP7skeSMeStkmh+3x5sWvw=
70+
github.com/aws-controllers-k8s/runtime v0.8.0 h1:zVlcHsZ1UkzZQ3467l1h9xiC8YHirWFbAou2VbFku58=
71+
github.com/aws-controllers-k8s/runtime v0.8.0/go.mod h1:xA2F18PJerBHaqrS4de1lpP7skeSMeStkmh+3x5sWvw=
7272
github.com/aws/aws-sdk-go v1.37.4 h1:tWxrpMK/oRSXVnjUzhGeCWLR00fW0WF4V4sycYPPrJ8=
7373
github.com/aws/aws-sdk-go v1.37.4/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
7474
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=

pkg/generate/ack/runtime_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ package ack
1515

1616
import (
1717
"context"
18+
"reflect"
1819
"testing"
1920

2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -159,4 +160,11 @@ func TestRuntimeDependency(t *testing.T) {
159160

160161
// ACK runtime 0.7.0 introduced SecretNotFound error.
161162
require.NotNil(ackerr.SecretNotFound)
163+
164+
// ACK runtime 0.8.0 removed the unused UpdateCRStatus method from
165+
// AWSResourceDescriptor
166+
rd := new(acktypes.AWSResourceDescriptor)
167+
rdType := reflect.TypeOf(rd)
168+
_, found := rdType.MethodByName("UpdateCRStatus")
169+
require.False(found)
162170
}

templates/pkg/resource/descriptor.go.tpl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,6 @@ func (d *resourceDescriptor) Delta(a, b acktypes.AWSResource) *ackcompare.Delta
5757
return newResourceDelta(a.(*resource), b.(*resource))
5858
}
5959

60-
// UpdateCRStatus accepts an AWSResource object and changes the Status
61-
// sub-object of the AWSResource's Kubernetes custom resource (CR) and
62-
// returns whether any changes were made
63-
func (d *resourceDescriptor) UpdateCRStatus(
64-
res acktypes.AWSResource,
65-
) (bool, error) {
66-
updated := true
67-
return updated, nil
68-
}
69-
7060
// IsManaged returns true if the supplied AWSResource is under the management
7161
// of an ACK service controller. What this means in practice is that the
7262
// underlying custom resource (CR) in the AWSResource has had a
@@ -147,4 +137,4 @@ func (d *resourceDescriptor) MarkAdopted(
147137
}
148138
curr[ackv1alpha1.AnnotationAdopted] = "true"
149139
obj.SetAnnotations(curr)
150-
}
140+
}

0 commit comments

Comments
 (0)