-
Notifications
You must be signed in to change notification settings - Fork 216
get stored secrets and configmaps from packet without dependency on c… #2500
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,6 @@ | |
| import oracle.kubernetes.operator.DomainStatusUpdater; | ||
| import oracle.kubernetes.operator.MakeRightDomainOperation; | ||
| import oracle.kubernetes.operator.ProcessingConstants; | ||
| import oracle.kubernetes.operator.calls.AsyncRequestStep; | ||
| import oracle.kubernetes.operator.calls.CallResponse; | ||
| import oracle.kubernetes.operator.helpers.EventHelper.EventData; | ||
| import oracle.kubernetes.operator.helpers.EventHelper.EventItem; | ||
|
|
@@ -80,12 +79,12 @@ public NextAction onSuccess(Packet packet, CallResponse<V1SecretList> callRespon | |
| } | ||
|
|
||
| static List<V1Secret> getSecrets(Packet packet) { | ||
| return Optional.ofNullable(getSecretsIfContinue(packet)).orElse(new ArrayList<>()); | ||
| return Optional.ofNullable(getSecretsFromPacket(packet)).orElse(new ArrayList<>()); | ||
| } | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
| private static List<V1Secret> getSecretsIfContinue(Packet packet) { | ||
| return packet.get(AsyncRequestStep.CONTINUE) != null ? (List<V1Secret>) packet.get(SECRETS) : null; | ||
| private static List<V1Secret> getSecretsFromPacket(Packet packet) { | ||
| return packet.get(SECRETS) != null ? (List<V1Secret>) packet.get(SECRETS) : null; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -105,12 +104,12 @@ public NextAction onSuccess(Packet packet, CallResponse<V1ConfigMapList> callRes | |
| } | ||
|
|
||
| static List<V1ConfigMap> getConfigMaps(Packet packet) { | ||
| return Optional.ofNullable(getConfigMapsIfContinue(packet)).orElse(new ArrayList<>()); | ||
| return Optional.ofNullable(getConfigMapsFromPacket(packet)).orElse(new ArrayList<>()); | ||
|
||
| } | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
| private static List<V1ConfigMap> getConfigMapsIfContinue(Packet packet) { | ||
| return packet.get(AsyncRequestStep.CONTINUE) != null ? (List<V1ConfigMap>) packet.get(CONFIGMAPS) : null; | ||
| private static List<V1ConfigMap> getConfigMapsFromPacket(Packet packet) { | ||
| return packet.get(CONFIGMAPS) != null ? (List<V1ConfigMap>) packet.get(CONFIGMAPS) : null; | ||
|
||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just inline (List) packet.get(SECRETS) here and remove the getSecretsFromPacket method.