In spring-cloud-kubernetes
we have the annotation :
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@ConditionalOnProperty(value = "spring.cloud.kubernetes.enabled", matchIfMissing = true)
public @interface ConditionalOnKubernetesEnabled {
}
I wanted to replace it with ConditionalOnCloudPlatform
, but the problem is that in the vast majority of cases we rely on ConditionalOnKubernetesEnabled
with matchIfMissing = true
. I was wondering if adding such a matchIfMissing
would make sense for ConditionalOnCloudPlatform
.
Comment From: wilkinsona
Thanks for the suggestion. I don't think matchIfMissing
really makes sense for ConditionalOnCloudPlatform
as it would result in the condition always matching. For example, @ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES, matchIfMissing = true)
would match both on Kubernetes and in any environment where Kubernetes was not detected. Perhaps I have misunderstood how you imagined the attribute would behave. What did you have in mind?
Comment From: wind57
I can be very stupid at times :) (or tired), please ignore and sorry for taking your time.