63 lines
1.7 KiB
Java
Executable File
63 lines
1.7 KiB
Java
Executable File
package dev.dinauer.service;
|
|
|
|
import java.util.List;
|
|
import java.util.Optional;
|
|
|
|
import jakarta.enterprise.context.ApplicationScoped;
|
|
import jakarta.inject.Inject;
|
|
|
|
import org.jboss.resteasy.reactive.common.NotImplementedYet;
|
|
|
|
import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition;
|
|
import io.fabric8.kubernetes.client.Watch;
|
|
import io.fabric8.kubernetes.client.Watcher;
|
|
import io.fabric8.kubernetes.client.dsl.ApiextensionsAPIGroupDSL;
|
|
|
|
import dev.dinauer.utils.ClientProvider;
|
|
|
|
@ApplicationScoped
|
|
public class CustomResourceDefinitionService implements ResourceService<CustomResourceDefinition>
|
|
{
|
|
@Inject
|
|
ClientProvider clientProvider;
|
|
|
|
@Override
|
|
public void delete(String name, String namespace)
|
|
{
|
|
throw new NotImplementedYet();
|
|
}
|
|
|
|
@Override
|
|
public CustomResourceDefinition findByNameAndNamespace(String name, String namespace)
|
|
{
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
|
|
@Override
|
|
public List<CustomResourceDefinition> findByNamespace(String namespace)
|
|
{
|
|
return findAll();
|
|
}
|
|
|
|
@Override
|
|
public List<CustomResourceDefinition> findAll()
|
|
{
|
|
try (ApiextensionsAPIGroupDSL apiextensions = clientProvider.getClient().apiextensions())
|
|
{
|
|
return apiextensions.v1().customResourceDefinitions().list().getItems();
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public Optional<CustomResourceDefinition> findOptionalByNameAndNamespace(String name, String namespace)
|
|
{
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
|
|
@Override
|
|
public Watch watch(String namespace, Watcher<CustomResourceDefinition> watcher)
|
|
{
|
|
throw new NotImplementedYet();
|
|
}
|
|
}
|