Skip to content

Commit c7e65c3

Browse files
Merge pull request redhat-appstudio#610 from stuartwdouglas/disable-kube
Ability to disable kube in the cache
2 parents 284128a + 86dead1 commit c7e65c3

File tree

1 file changed

+5
-1
lines changed
  • java-components/cache/src/main/java/com/redhat/hacbs/artifactcache/artifactwatch

1 file changed

+5
-1
lines changed

java-components/cache/src/main/java/com/redhat/hacbs/artifactcache/artifactwatch/CacheControl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import javax.inject.Inject;
99

1010
import org.apache.http.client.utils.DateUtils;
11+
import org.eclipse.microprofile.config.inject.ConfigProperty;
1112

1213
import com.redhat.hacbs.artifactcache.services.StorageManager;
1314
import com.redhat.hacbs.resources.model.v1alpha1.ModelConstants;
@@ -33,9 +34,12 @@ public class CacheControl {
3334
KubernetesClient client;
3435
SharedIndexInformer<GenericKubernetesResource> informer;
3536

37+
@ConfigProperty(name = "kube.disabled", defaultValue = "false")
38+
boolean disabled;
39+
3640
@PostConstruct
3741
void setup() {
38-
if (LaunchMode.current() == LaunchMode.TEST) {
42+
if (LaunchMode.current() == LaunchMode.TEST || disabled) {
3943
//don't start in tests, as kube might not be present
4044
return;
4145
}

0 commit comments

Comments
 (0)