Skip to content

Commit

Permalink
Add desperate logging
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Jan 23, 2025
1 parent e19c74c commit 13b39da
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ public DevServicesResultBuildItem setupKubernetesDevService(
LoggingSetupBuildItem loggingSetupBuildItem,
DevServicesConfig devServicesConfig) {

System.out.println("HOLLY KUBE setting up Kubernetes DevServices existing " + devService);
System.out.println("HOLLY KUBE ds config " + devServicesConfig.enabled());

KubernetesDevServiceCfg configuration = getConfiguration(kubernetesClientBuildTimeConfig);
System.out.println("HOLLY KUBE config enabled = " + configuration.devServicesEnabled);

if (devService != null) {
boolean shouldShutdownTheCluster = !configuration.equals(cfg);
Expand All @@ -106,6 +110,7 @@ public DevServicesResultBuildItem setupKubernetesDevService(
(launchMode.isTest() ? "(test) " : "") + "Kubernetes Dev Services Starting:",
consoleInstalledBuildItem, loggingSetupBuildItem);
try {
System.out.println("HOLLY KUBE about to call the method start kube which doesn't actually start it");
devService = startKubernetes(dockerStatusBuildItem, configuration, launchMode,
!devServicesSharedNetworkBuildItem.isEmpty(),
devServicesConfig.timeout());
Expand Down Expand Up @@ -144,6 +149,7 @@ public DevServicesResultBuildItem setupKubernetesDevService(
+ "cluster automatically.");
}

System.out.println("HOLLY KUBE made the dev services result " + devService);
return devService.toBuildItem();
}

Expand All @@ -162,6 +168,7 @@ private void shutdownCluster() {
@SuppressWarnings("unchecked")
private RunningDevService startKubernetes(DockerStatusBuildItem dockerStatusBuildItem, KubernetesDevServiceCfg config,
LaunchModeBuildItem launchMode, boolean useSharedNetwork, Optional<Duration> timeout) {
System.out.println("HOLLY KUBE about to start " + config.devServicesEnabled);
if (!config.devServicesEnabled) {
// explicitly disabled
log.debug("Not starting Dev Services for Kubernetes, as it has been disabled in the config.");
Expand All @@ -173,29 +180,38 @@ private RunningDevService startKubernetes(DockerStatusBuildItem dockerStatusBuil
log.debug("Not starting Dev Services for Kubernetes, the " + KUBERNETES_CLIENT_MASTER_URL + " is configured.");
return null;
}
System.out.println("HOLLY KUBE config override " + config.overrideKubeconfig);

if (!config.overrideKubeconfig) {
var autoConfigMasterUrl = Config.autoConfigure(null).getMasterUrl();
System.out.println("HOLLY KUBE comparing " + DEFAULT_MASTER_URL_ENDING_WITH_SLASH + " and "
+ autoConfigMasterUrl);
if (!DEFAULT_MASTER_URL_ENDING_WITH_SLASH.equals(autoConfigMasterUrl)) {
System.out.println("HOLLY KUBE bailing because " + DEFAULT_MASTER_URL_ENDING_WITH_SLASH + " is not "
+ autoConfigMasterUrl);
log.debug(
"Not starting Dev Services for Kubernetes, the Kubernetes client is auto-configured. Set "
+ KUBERNETES_CLIENT_DEVSERVICES_OVERRIDE_KUBECONFIG
+ " to true to use Dev Services for Kubernetes.");
return null;
}
}
System.out.println("HOLLY KUBE got past config override ");

if (!dockerStatusBuildItem.isContainerRuntimeAvailable()) {
log.warn(
"Docker isn't working, please configure the Kubernetes client.");
return null;
}
System.out.println("HOLLY KUBE got past runtime check ");

final Optional<ContainerAddress> maybeContainerAddress = KubernetesContainerLocator.locateContainer(config.serviceName,
config.shared,
launchMode.getLaunchMode());
System.out.println("HOLLY KUBE container address " + maybeContainerAddress);

final Supplier<RunningDevService> defaultKubernetesClusterSupplier = () -> {
System.out.println("HOLLY KUBE default supplier doing its thing! " + config.flavor);
KubernetesContainer container;
switch (config.flavor) {
case api_only:
Expand Down Expand Up @@ -228,6 +244,7 @@ private RunningDevService startKubernetes(DockerStatusBuildItem dockerStatusBuil
timeout.ifPresent(container::withStartupTimeout);

container.withEnv(config.containerEnv);
System.out.println("HOLLY KUBE really starting the container! ");

container.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public Map<String, String> start() {
server = createServer();
initServer();

System.out.println("HOLLY KUBE doing system props " + getClient().getConfiguration().getMasterUrl());
systemProps.put(Config.KUBERNETES_MASTER_SYSTEM_PROPERTY, getClient().getConfiguration().getMasterUrl());

configureServer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected void initServer() {

@Override
protected KubernetesMockServer createServer() {
System.out.println("HOLLY KUBE mock server creating server");
return createMockServer();
}

Expand Down

0 comments on commit 13b39da

Please sign in to comment.