-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix 1757 #1914
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
Fix 1757 #1914
Conversation
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>
Signed-off-by: wind57 <[email protected]>
@@ -18,17 +18,11 @@ | |||
|
|||
import org.springframework.boot.context.properties.ConfigurationProperties; | |||
|
|||
@ConfigurationProperties("green-purple-secret.green-purple-secret-k8s.green-secret.green-secret-k8s.green-secret-prod") |
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.
here is an example of a test that fixes the problem
@@ -390,7 +399,7 @@ public static final class Prefix { | |||
/** | |||
* prefix is known at the callsite. | |||
*/ | |||
public static Prefix KNOWN; | |||
public static Prefix KNOWN = new Prefix(() -> "", "KNOWN"); |
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.
this is a minor bug fix, that someone was not found until now, not really related to the fix itself
The entire fix of the issue is based on the fact that we can (ab)use
What we used to do, is keep inside What I am proposing to do (and it would not be a breaking change, since public APIs don't break), is to still capture in
and yes, later in the code have a few casts. The idea is that is not going to be a breaking change anymore, granted, it is a bit ugly. But this "ugliness" can be re-factored away (which I will do of course) and be merged in the next major, without the casts and to slightly adjust the code. Everything in this PR comes from this idea, all changes are reflecting it. I also took a chance to refactor some of the code. Over the years (I can't believe its been years tbh!), we have fixed a few issues around Now looks a lot easier to maintain. I did the same clean-up for I do understand that there are a lot of files to look at, but the vast majority are tests and if you start from the idea above, it might be not that complicated to grok them. |
btw, there is no documentation for this PR, which I wanted to make a PR immediately after this one |
Signed-off-by: wind57 <[email protected]>
* When there is no data, the name of the property source is made from provided | ||
* labels, unlike when the data is present: when we use secret names. | ||
*/ | ||
private SourceData emptySourceData(Map<String, String> labels, String target, String namespace) { |
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.
Wouldn't the secret still have a name in this case?
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.
imho, in this case it does not matter, as there is nothing to wire from such sources, they are empty, so this bug does not affect these cases
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.
But did the name of the empty property source also have the same problem as non-empty property sources?
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.
not really. The name matters only when there is data also, but in this case data does not exist. Also, imo, this clearly denotes that : "we searched by these labels" and did not find anything... I hope I understood your question correctly.
sourceDataForSourceName, prefix.prefixProvider().get())); | ||
} | ||
|
||
if (prefix.getName().equals(Prefix.DELAYED.getName())) { |
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.
What is a delayed prefix?
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 had this for a while, I am not introducing it.
It's for the cases when you enabled "use-name-as-prefix", but the search happens based on labels, so the actual prefix is "delayed". Meaning we do not know it upfront, we will later, when we actually read by labels and find those names
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.
ok i just needed a refresher because its been a while
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.
I reviewed this PR with respect to wether it fixes the issue we face (#1757), which it does.
thank you for looking at it @jnodorp-jaconi |
I am aware that PR failed, I am looking into why and update |
@ryanjbaxter all PRs failed ( |
@wind57 yes I will try in a bit |
No description provided.