File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
examples/src/main/java/io/kubernetes/client/examples Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 7
7
import io .kubernetes .client .openapi .Configuration ;
8
8
import io .kubernetes .client .util .Config ;
9
9
import java .time .Duration ;
10
+ import java .util .UUID ;
10
11
11
12
/**
12
13
* A simple example of how to use the Java API
@@ -21,7 +22,11 @@ public static void main(String[] args) throws Exception {
21
22
ApiClient client = Config .defaultClient ();
22
23
Configuration .setDefaultApiClient (client );
23
24
24
- EndpointsLock lock = new EndpointsLock ("kube-system" , "leader-election" , "foo" );
25
+ // New
26
+ String appNamespace = "default" ;
27
+ String appName = "leader-election-foobar" ;
28
+ String lockHolderIdentityName = UUID .randomUUID ().toString (); // Anything unique
29
+ EndpointsLock lock = new EndpointsLock (appNamespace , appName , lockHolderIdentityName );
25
30
26
31
LeaderElectionConfig leaderElectionConfig =
27
32
new LeaderElectionConfig (
You can’t perform that action at this time.
0 commit comments