Skip to content

Commit

Permalink
refactor: bump kubernetes client to 6.12.0 (#248) (#249)
Browse files Browse the repository at this point in the history
* refactor: bump kubernetes client to 6.12.0 (#248)
* replace deprecated apache commons StringUtils
* corrected impl dependency to intellij-kubernetes
* removed deprecated overrides

Signed-off-by: Andre Dietisheim <[email protected]>
  • Loading branch information
adietish authored Apr 18, 2024
1 parent 1249359 commit adb7355
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 33 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ intellij {
'yaml',
'org.jetbrains.plugins.github',
'com.intellij.kubernetes:' + versionsMap[ideaVersion],
'com.redhat.devtools.intellij.telemetry:1.1.0.52',
'com.redhat.devtools.intellij.kubernetes:1.2.3.294']
'com.redhat.devtools.intellij.telemetry:1.1.0.52']
updateSinceUntilBuild = false
}

Expand All @@ -50,13 +49,13 @@ runIdeForUiTests {
buildSearchableOptions.enabled = false

dependencies {
implementation 'io.fabric8:knative-client:6.4.1'
implementation 'com.redhat.devtools.intellij:intellij-common:1.9.1'
implementation 'com.squareup.okio:okio:3.1.0'
implementation 'io.fabric8:knative-client:6.12.0'
implementation 'io.fabric8:openshift-client:6.12.0'
implementation 'com.redhat.devtools.intellij:intellij-common:1.9.4'
testImplementation 'org.mockito:mockito-inline:4.6.1'
// telemetry contributes annotations 13.0.0, so we need to declare newer version
implementation 'org.jetbrains:annotations:23.0.0'
testImplementation 'com.redhat.devtools.intellij:intellij-common:1.9.1:test'
testImplementation 'com.redhat.devtools.intellij:intellij-common:1.9.4:test'
}

configurations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@
import com.redhat.devtools.intellij.common.utils.ExecHelper;
import com.redhat.devtools.intellij.common.utils.ExecProcessHandler;
import com.redhat.devtools.intellij.common.utils.NetworkUtils;
import com.redhat.devtools.intellij.knative.telemetry.TelemetryService;
import com.redhat.devtools.intellij.knative.func.FuncActionPipelineManager;
import com.redhat.devtools.intellij.knative.telemetry.TelemetryService;
import com.redhat.devtools.intellij.knative.ui.createFunc.CreateFuncModel;
import com.redhat.devtools.intellij.knative.ui.repository.Repository;
import com.redhat.devtools.intellij.knative.utils.model.GitRepoModel;
import com.redhat.devtools.intellij.knative.utils.model.ImageRegistryModel;
import com.redhat.devtools.intellij.knative.utils.model.InvokeModel;
import com.redhat.devtools.intellij.knative.ui.repository.Repository;
import com.redhat.devtools.intellij.telemetry.core.service.TelemetryMessageBuilder;
import io.fabric8.knative.client.KnativeClient;
import io.fabric8.kubernetes.api.model.GenericKubernetesResource;
import io.fabric8.kubernetes.client.ConfigBuilder;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import io.fabric8.kubernetes.client.KubernetesClientException;
import io.fabric8.kubernetes.client.Watch;
import io.fabric8.kubernetes.client.Watcher;
Expand Down Expand Up @@ -80,7 +79,7 @@ public KnCli(Project project, String knCommand, String funcCommand) {
this.knCommand = knCommand;
this.funcCommand = funcCommand;
this.project = project;
this.client = new DefaultKubernetesClient(new ConfigBuilder().build());
this.client = new KubernetesClientBuilder().build();
this.funcActionPipelineManager = new FuncActionPipelineManager();
try {
this.envVars = NetworkUtils.buildEnvironmentVariables(client.getMasterUrl().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ public boolean isBackgroundJobRunning() {
public void addSettingsListener(@NotNull ProjectGeneratorPeer.SettingsListener listener) {
ProjectGeneratorPeer.super.addSettingsListener(listener);
}

@Override
public void addSettingsStateListener(@NotNull WebProjectGenerator.SettingsStateListener listener) {

}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ public void projectClosing(@NotNull Project project) {
public boolean shouldBeAvailable(@NotNull Project project) {
return true;
}

@Override
public boolean isDoNotActivateOnStart() {
return true;
}

}

class ContentChangeManagerListener implements ContentManagerListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,23 @@
package com.redhat.devtools.intellij.knative.utils;

import com.intellij.openapi.ui.SimpleToolWindowPanel;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentManager;
import com.intellij.ui.treeStructure.Tree;
import com.redhat.devtools.intellij.knative.Constants;
import com.redhat.devtools.intellij.knative.BaseTest;
import com.redhat.devtools.intellij.knative.Constants;
import com.redhat.devtools.intellij.knative.kn.Kn;
import com.redhat.devtools.intellij.knative.tree.KnTreeStructure;
import javax.swing.JViewport;
import org.apache.commons.lang.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.MockedStatic;

import javax.swing.*;

import static com.redhat.devtools.intellij.knative.Constants.KNATIVE_FUNC_TOOL_WINDOW_ID;
import static com.redhat.devtools.intellij.knative.Constants.KNATIVE_LOCAL_FUNC_TOOL_WINDOW_ID;
import static com.redhat.devtools.intellij.knative.Constants.KNATIVE_TOOL_WINDOW_ID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mockStatic;
Expand Down Expand Up @@ -73,7 +66,7 @@ public void tearDown() throws Exception {
}

public void testTrimErrorMessage_ErrorMessageLongerThan130_ErrorMessageTrimmed() {
String longErrorMessage = StringUtils.repeat("a", 140);
String longErrorMessage = StringUtil.repeat("a", 140);
String resultingErrorMessage = longErrorMessage.substring(0, 130) + "...";
assertEquals(resultingErrorMessage, TreeHelper.trimErrorMessage(longErrorMessage));
}
Expand Down

0 comments on commit adb7355

Please sign in to comment.