Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce code smells in OperationContext class #2880

Merged
merged 1 commit into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class BaseOperation<T extends HasMetadata, L extends KubernetesResourceLi
private static final String INVOLVED_OBJECT_API_VERSION = "involvedObject.apiVersion";
private static final String INVOLVED_OBJECT_FIELD_PATH = "involvedObject.fieldPath";

private final Boolean cascading;
private final boolean cascading;
private final T item;

private final Map<String, String> labels;
Expand All @@ -110,7 +110,7 @@ public class BaseOperation<T extends HasMetadata, L extends KubernetesResourceLi
private final Map<String, String[]> fieldsNot;

private final String resourceVersion;
private final Boolean reloadingFromServer;
private final boolean reloadingFromServer;
private final long gracePeriodSeconds;
private final DeletionPropagation propagationPolicy;
private final long watchRetryInitialBackoffMillis;
Expand All @@ -125,7 +125,7 @@ protected BaseOperation(OperationContext ctx) {
super(ctx);
this.cascading = ctx.getCascading();
this.item = (T) ctx.getItem();
this.reloadingFromServer = ctx.getReloadingFromServer();
this.reloadingFromServer = ctx.isReloadingFromServer();
this.resourceVersion = ctx.getResourceVersion();
this.gracePeriodSeconds = ctx.getGracePeriodSeconds();
this.propagationPolicy = ctx.getPropagationPolicy();
Expand Down Expand Up @@ -166,8 +166,6 @@ private L listRequestHelper(URL url) {
} catch (ExecutionException | IOException e) {
throw KubernetesClientException.launderThrowable(forOperationType("list"), e);
}


}

protected URL fetchListUrl(URL url, ListOptions listOptions) throws MalformedURLException {
Expand Down Expand Up @@ -954,11 +952,6 @@ public String getResourceVersion() {
return resourceVersion;
}

@Deprecated
public Boolean getReloadingFromServer() {
return isReloadingFromServer();
}

public Boolean isReloadingFromServer() {
return reloadingFromServer;
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ private List<RollableScalableResource<ReplicaSet>> doGetLog() {
new RollingOperationContext(context.getClient(), context.getConfig(), context.getPlural(), context.getNamespace(),
null, context.getApiGroupName(), context.getApiGroupVersion(), context.getCascading(), null, context.getLabels(),
context.getLabelsNot(), context.getLabelsIn(), context.getLabelsNotIn(), context.getFields(), context.getFieldsNot(),
context.getResourceVersion(), context.getReloadingFromServer(), context.getGracePeriodSeconds(), context.getPropagationPolicy(),
context.getResourceVersion(), context.isReloadingFromServer(), context.getGracePeriodSeconds(), context.getPropagationPolicy(),
context.getWatchRetryInitialBackoffMillis(), context.getWatchRetryBackoffMultiplier(), false, 0, null,
context.isNamespaceFromGlobalConfig()), podLogWaitTimeout);
ReplicaSetList rcList = rsOperations.withLabels(getDeploymentSelectorLabels(deployment)).list();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private List<RollableScalableResource<ReplicaSet>> doGetLog() {
new RollingOperationContext(context.getClient(), context.getConfig(), context.getPlural(), context.getNamespace(),
null, context.getApiGroupName(), context.getApiGroupVersion(), context.getCascading(), null, context.getLabels(),
context.getLabelsNot(), context.getLabelsIn(), context.getLabelsNotIn(), context.getFields(), context.getFieldsNot(),
context.getResourceVersion(), context.getReloadingFromServer(), context.getGracePeriodSeconds(), context.getPropagationPolicy(),
context.getResourceVersion(), context.isReloadingFromServer(), context.getGracePeriodSeconds(), context.getPropagationPolicy(),
context.getWatchRetryInitialBackoffMillis(), context.getWatchRetryBackoffMultiplier(), false, 0, null,
context.isNamespaceFromGlobalConfig()), podLogWaitTimeout);
ReplicaSetList rcList = rsOperations.withLabels(getDeploymentSelectorLabels(deployment)).list();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static PodOperationsImpl getGenericPodOperations(OperationContext context
context.getConfig(), context.getPlural(), context.getNamespace(), null, null,
"v1", context.getCascading(), context.getItem(), context.getLabels(), context.getLabelsNot(),
context.getLabelsIn(), context.getLabelsNotIn(), context.getFields(), context.getFieldsNot(), context.getResourceVersion(),
context.getReloadingFromServer(), context.getGracePeriodSeconds(), context.getPropagationPolicy(),
context.isReloadingFromServer(), context.getGracePeriodSeconds(), context.getPropagationPolicy(),
context.getWatchRetryInitialBackoffMillis(), context.getWatchRetryBackoffMultiplier(), context.isNamespaceFromGlobalConfig(), null, null, null, null, null,
null, null, null, null, false, false, false, null, null,
null, isPretty, null, null, null, null, null, podLogWaitTimeout));
Expand Down
Loading