Commit 727a784
committed
CKS: handle VPC tier with no attached network ACL
A VPC tier without an attached ACL is a valid, supported state (aclid is
optional on createNetwork; CloudStack stopped assigning a default-deny
ACL unconditionally in CLOUDSTACK-2809). However, four CKS lifecycle sites
compared the nullable Long returned by Network.getNetworkACLId() against
the primitive long constants NetworkACL.DEFAULT_ALLOW / DEFAULT_DENY,
auto-unboxing it and throwing NullPointerException when the tier had no
ACL attached. This broke CKS cluster create/start/delete on a legitimate
VPC tier configuration and left clusters stuck in Starting.
Make the four comparisons null-safe with Objects.equals so that:
- validateVpcTier accepts a null ACL (a valid state) instead of NPE-ing;
- createVpcTierAclRules and setupKubernetesEtcdNetworkRules reach the
existing NetworkACLService auto-create path
(NetworkACLServiceImpl.createAclListIfNeeded) that creates and attaches
a custom ACL when a rule is added with networkid and no aclid;
- removeVpcTierAclRules treats a missing ACL as a no-op on delete.
Adds regression unit tests:
- KubernetesClusterManagerImplTest#testValidateVpcTierNullAclId
- KubernetesClusterResourceModifierActionWorkerTest#removeVpcTierAclRulesNullAclIdIsNoOp
Fixes #13761
Signed-off-by: Desmond <60381871+goal86sg@users.noreply.github.com>1 parent 8902c32 commit 727a784
5 files changed
Lines changed: 25 additions & 4 deletions
File tree
- plugins/integrations/kubernetes-service/src
- main/java/com/cloud/kubernetes/cluster
- actionworkers
- test/java/com/cloud/kubernetes/cluster
- actionworkers
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
| 614 | + | |
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | | - | |
| 784 | + | |
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
| 649 | + | |
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
148 | 158 | | |
149 | 159 | | |
150 | 160 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
138 | 149 | | |
0 commit comments