forked from fabric8io/kubernetes-client
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix fabric8io#2712: Add Support for watching logs in multi-container …
…Controllers Signed-off-by: Rohan Kumar <[email protected]>
- Loading branch information
1 parent
1f5061f
commit fc7c0d1
Showing
16 changed files
with
270 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...rc/main/java/io/fabric8/kubernetes/client/dsl/internal/PodControllerOperationContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/** | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.kubernetes.client.dsl.internal; | ||
|
||
import io.fabric8.kubernetes.api.model.DeletionPropagation; | ||
import io.fabric8.kubernetes.client.Config; | ||
import io.fabric8.kubernetes.client.dsl.Operation; | ||
import io.fabric8.kubernetes.client.dsl.base.OperationContext; | ||
import okhttp3.OkHttpClient; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
public class PodControllerOperationContext extends OperationContext { | ||
protected String containerId; | ||
|
||
public PodControllerOperationContext() { } | ||
|
||
public PodControllerOperationContext(OkHttpClient client, Config config, String plural, String namespace, String name, String containerId, String apiGroupName, String apiGroupVersion, boolean cascading, Object item, Map<String, String> labels, Map<String, String[]> labelsNot, Map<String, String[]> labelsIn, Map<String, String[]> labelsNotIn, Map<String, String> fields, Map<String, String[]> fieldsNot, String resourceVersion, boolean reloadingFromServer, long gracePeriodSeconds, DeletionPropagation propagationPolicy, long watchRetryInitialBackoffMillis, double watchRetryBackoffMultiplier, boolean isNamespaceFromGlobalConfig, boolean dryRun) { | ||
super(client, config, plural, namespace, name, apiGroupName, apiGroupVersion, cascading, item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, isNamespaceFromGlobalConfig, dryRun); | ||
this.containerId = containerId; | ||
} | ||
|
||
public String getContainerId() { | ||
return containerId; | ||
} | ||
|
||
public PodControllerOperationContext withContainerId(String containerId) { | ||
return new PodControllerOperationContext(client, config, plural, namespace, name, containerId, apiGroupName, apiGroupVersion, cascading, item, labels, labelsNot, labelsIn, labelsNotIn, fields, fieldsNot, resourceVersion, reloadingFromServer, gracePeriodSeconds, propagationPolicy, watchRetryInitialBackoffMillis, watchRetryBackoffMultiplier, namespaceFromGlobalConfig, dryRun); | ||
} | ||
|
||
public PodControllerOperationContext withOkhttpClient(OkHttpClient client) { | ||
if (this.client == client) { | ||
return this; | ||
} | ||
return new PodControllerOperationContext(client, this.config, this.plural, this.namespace, this.name, this.containerId, this.apiGroupName, | ||
this.apiGroupVersion, this.cascading, this.item, this.labels, this.labelsNot, this.labelsIn, this.labelsNotIn, | ||
this.fields, this.fieldsNot, this.resourceVersion, this.reloadingFromServer, this.gracePeriodSeconds, | ||
this.propagationPolicy, this.watchRetryInitialBackoffMillis, this.watchRetryBackoffMultiplier, | ||
this.namespaceFromGlobalConfig, this.dryRun); | ||
} | ||
|
||
public PodControllerOperationContext withConfig(Config config) { | ||
if (this.config == config) { | ||
return this; | ||
} | ||
return new PodControllerOperationContext(this.client, config, this.plural, this.namespace, this.name, this.containerId, this.apiGroupName, | ||
this.apiGroupVersion, this.cascading, this.item, this.labels, this.labelsNot, this.labelsIn, this.labelsNotIn, | ||
this.fields, this.fieldsNot, this.resourceVersion, this.reloadingFromServer, this.gracePeriodSeconds, | ||
this.propagationPolicy, this.watchRetryInitialBackoffMillis, this.watchRetryBackoffMultiplier, | ||
this.namespaceFromGlobalConfig, this.dryRun); | ||
} | ||
|
||
public PodControllerOperationContext withNamespace(String namespace) { | ||
if (Objects.equals(this.namespace, namespace)) { | ||
return this; | ||
} | ||
return new PodControllerOperationContext(this.client, this.config, this.plural, namespace, this.name, this.containerId, this.apiGroupName, | ||
this.apiGroupVersion, this.cascading, this.item, this.labels, this.labelsNot, this.labelsIn, this.labelsNotIn, | ||
this.fields, this.fieldsNot, this.resourceVersion, this.reloadingFromServer, this.gracePeriodSeconds, | ||
this.propagationPolicy, this.watchRetryInitialBackoffMillis, this.watchRetryBackoffMultiplier, | ||
this.namespaceFromGlobalConfig, this.dryRun); | ||
} | ||
|
||
public PodControllerOperationContext withPropagationPolicy(DeletionPropagation propagationPolicy) { | ||
if (this.propagationPolicy == propagationPolicy) { | ||
return this; | ||
} | ||
return new PodControllerOperationContext(this.client, this.config, this.plural, this.namespace, this.name, this.containerId, this.apiGroupName, | ||
this.apiGroupVersion, this.cascading, this.item, this.labels, this.labelsNot, this.labelsIn, this.labelsNotIn, | ||
this.fields, this.fieldsNot, this.resourceVersion, this.reloadingFromServer, this.gracePeriodSeconds, | ||
propagationPolicy, this.watchRetryInitialBackoffMillis, this.watchRetryBackoffMultiplier, | ||
this.namespaceFromGlobalConfig, this.dryRun); | ||
} | ||
} |
Oops, something went wrong.