-
Notifications
You must be signed in to change notification settings - Fork 447
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
SecretEnricher getSecretsFromXmlConfig
should return Collections.emptyList()
instead of null
#2530
Closed
3 tasks done
Closed
3 tasks done
Labels
Milestone
Comments
Hi @rohanKanojia, I'm willing to pick this issue. Please assign this issue to me. |
@l3002 : This is a slightly involved issue. It's not recommended for beginners. You can pick this once you get a PR merged with |
@rohanKanojia, Sure, I'm working on one right now. |
Could you please assign this to me? |
Closed
17 tasks
Closed
17 tasks
sankritimishra
added a commit
to sankritimishra/jkube
that referenced
this issue
Feb 1, 2024
…yList() instead of null eclipse-jkube#2530
17 tasks
sankritimishra
added a commit
to sankritimishra/jkube
that referenced
this issue
Feb 1, 2024
…yList() instead of null eclipse-jkube#2530
Merged
17 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component
JKube Kit
Task description
Description
SecretEnricher has this private method which returns
null
that is reported by Sonar as a code smell:https://github.com/eclipse/jkube/blob/275dc11e9bd0a268aac94f112ac2c443960d957b/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/SecretEnricher.java#L130-L135
We should refactor this method so that it always returns a list. We should return
Collections.emptyList()
instead ofnull
. It would be nice to get rid ofif
block using Java'aOptional.ofNullable
.Expected Behavior
getSecretsFromXmlConfig
is refactored to return a non-null list alwaysAcceptance Criteria
getSecretsFromXmlConfig
is refactored to return a nonnull
valuegetSecretsFromXmlConfig
usesOptional.ofNullable
instead ofif
conditional to handle null casenull
check from the caller that receives list fromgetSecretsFromXmlConfig
Before you start 🔴
👇 👇 👇 👇 👇 👇 👇 👇 👇 👇👇👇👇👇👇👇
Make sure you read the contributing guide first. Pay special attention to the ECA agreement section and the requirement to sign-off your commit.
How to manually test my changes
Kubernetes
If you don't have a real Kubernetes cluster available (most probably), you can use Minikube or Kind to test with a local cluster.
OpenShift
If you don't have a real OpenShift cluster available (most probably), you can use Red Hat's developer Sandbox for Red Hat OpenShift. The only requirement is to have a Red Hat account.
Once you have your Sandbox environment, you'll need to download the oc tool from the cluster console.
(Press the
?
icon and from the context menu selectCommand line tools
, you'll be redirected to https://$subdomain.openshiftapps.com/command-lines-tools where you'll be able to download the CLI for your platform)The text was updated successfully, but these errors were encountered: