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

refactor: rename method more appropriately #2536

Merged
merged 1 commit into from
Sep 24, 2024
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 @@ -381,7 +381,7 @@ default <R extends HasMetadata, P extends HasMetadata> boolean shouldUseSSA(
.flatMap(KubernetesDependentResourceConfig::useSSA);
// don't use SSA for certain resources by default, only if explicitly overriden
if (useSSAConfig.isEmpty()
&& defaultNonSSAResource().contains(dependentResource.resourceType())) {
&& defaultNonSSAResources().contains(dependentResource.resourceType())) {
return false;
}
return useSSAConfig.orElse(ssaBasedCreateUpdateMatchForDependentResources());
Expand All @@ -397,12 +397,19 @@ && defaultNonSSAResource().contains(dependentResource.resourceType())) {
* By default, SSA is disabled for {@link ConfigMap} and {@link Secret} resources.
*
* @return The set of resource types for which SSA will not be used
* @since 4.4.0
*/
default Set<Class<? extends HasMetadata>> defaultNonSSAResource() {
default Set<Class<? extends HasMetadata>> defaultNonSSAResources() {
return Set.of(ConfigMap.class, Secret.class);
}

/**
* @deprecated Use {@link #defaultNonSSAResources()} instead
*/
@Deprecated(forRemoval = true)
default Set<Class<? extends HasMetadata>> defaultNonSSAResource() {
return defaultNonSSAResources();
}

/**
* If a javaoperatorsdk.io/previous annotation should be used so that the operator sdk can detect
* events from its own updates of dependent resources and then filter them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class ConfigurationServiceOverrider {
private Set<Class<? extends HasMetadata>> defaultNonSSAResource;
private Boolean previousAnnotationForDependentResources;
private Boolean parseResourceVersions;
@SuppressWarnings("rawtypes")
private DependentResourceFactory dependentResourceFactory;

ConfigurationServiceOverrider(ConfigurationService original) {
Expand Down Expand Up @@ -79,6 +80,7 @@ public ConfigurationServiceOverrider withMinConcurrentWorkflowExecutorThreads(in
return this;
}

@SuppressWarnings("rawtypes")
public ConfigurationServiceOverrider withDependentResourceFactory(
DependentResourceFactory dependentResourceFactory) {
this.dependentResourceFactory = dependentResourceFactory;
Expand Down Expand Up @@ -192,6 +194,7 @@ public boolean checkCRDAndValidateLocalModel() {
return checkCR != null ? checkCR : original.checkCRDAndValidateLocalModel();
}

@SuppressWarnings("rawtypes")
@Override
public DependentResourceFactory dependentResourceFactory() {
return dependentResourceFactory != null ? dependentResourceFactory
Expand Down Expand Up @@ -302,9 +305,9 @@ public boolean ssaBasedCreateUpdateMatchForDependentResources() {
}

@Override
public Set<Class<? extends HasMetadata>> defaultNonSSAResource() {
public Set<Class<? extends HasMetadata>> defaultNonSSAResources() {
return defaultNonSSAResource != null ? defaultNonSSAResource
: super.defaultNonSSAResource();
: super.defaultNonSSAResources();
}

@Override
Expand Down
Loading