Skip to content

Instantly share code, notes, and snippets.

@j-tim
Created October 11, 2019 11:20
Show Gist options
  • Save j-tim/da5ba2983b59cb911dd2a43b3376f7c4 to your computer and use it in GitHub Desktop.
Save j-tim/da5ba2983b59cb911dd2a43b3376f7c4 to your computer and use it in GitHub Desktop.
Spring Boot 2.2 @ConditionalOnCloudPlatform Kubernetes detection
package nl.jtim.spring.boot;
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.stereotype.Service;
@Service
@ConditionalOnCloudPlatform(CloudPlatform.KUBERNETES)
public class MyVeryCoolService {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment