Skip to content

remove getImmutableFieldChanges references from hooks #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions pkg/resource/key/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ package key

import (
"context"
"fmt"
"strconv"
"strings"

ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
ackerr "github.com/aws-controllers-k8s/runtime/pkg/errors"
ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log"
svcsdk "github.com/aws/aws-sdk-go-v2/service/kms"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -66,11 +63,6 @@ func (rm *resourceManager) customUpdate(
defer func() {
exit(err)
}()
if immutableFieldChanges := rm.getImmutableFieldChanges(delta); len(immutableFieldChanges) > 0 {
msg := fmt.Sprintf("Immutable Spec fields have been modified: %s",
strings.Join(immutableFieldChanges, ","))
return nil, ackerr.NewTerminalError(fmt.Errorf(msg))
}
updatedRes := rm.concreteResource(desired.DeepCopy())
updatedRes.SetStatus(latest)

Expand Down
12 changes: 0 additions & 12 deletions test/e2e/tests/test_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,6 @@ def test_update_key_policy(self, kms_client, key_with_policy):

key_policy = kms_client.get_key_policy(KeyId=key_id, PolicyName='default')
assert 'updated-key-policy' in key_policy['Policy']

# updating description should set terminal condition on the resource
# because only tags and policy related fields can be updated on the Key
# resource
updates = {
"spec": {
"description": 'only policy and tags update are supported'
}
}
k8s.patch_custom_resource(ref, updates)
time.sleep(MODIFY_WAIT_AFTER_SECONDS)
assert k8s.wait_on_condition(ref, "ACK.Terminal", "True", wait_periods=10)

def test_create_with_rotation(self, kms_client, key_with_rotation):
(ref, cr) = key_with_rotation
Expand Down