Error when upload file to container
See original GitHub issueGood afternoon.
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>5.8.0</version>
</dependency>
Good afternoon, trying to upload a file to a container like this:
io.fabric8.kubernetes.client.Config config = new ConfigBuilder()
.withMasterUrl(String.format("https://%s:%s/", namespace.getHost(), namespace.getPort()))
.withTrustCerts(true)
.withOauthToken(namespace.getToken())
.build();
try (KubernetesClient k8s = new DefaultKubernetesClient(config)) {
File fileToUpload = new File(srcFile);
k8s.pods().inNamespace(namespace.getName()) // <- Namespace of Pod
.withName(pod) // <- Name of Pod
.inContainer(container) //
.dir(targetFile) // <- Path of directory inside Pod
.upload(fileToUpload.toPath()); // <- Local Path of directory
}
Please tell me what could be the cause of the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: io/fabric8/kubernetes/model/annotation/Group
at io.fabric8.kubernetes.api.model.HasMetadata.getGroup(HasMetadata.java:89)
at io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext.fromResourceType(ResourceDefinitionContext.java:51)
at io.fabric8.kubernetes.client.ResourceHandlerImpl.<init>(ResourceHandlerImpl.java:43)
at io.fabric8.kubernetes.client.Handlers.register(Handlers.java:42)
at io.fabric8.kubernetes.client.BaseKubernetesClient.<clinit>(BaseKubernetesClient.java:129)
at ru.diasoft.micro.iaas.service.ContainerProviderImpl.main(ContainerProviderImpl.java:151)
Caused by: java.lang.ClassNotFoundException: io.fabric8.kubernetes.model.annotation.Group
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 6 more
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Upload fails in docker container. on Project:Support desk
Upload fails in docker container. ... Now I get this error just above the upload form: Could not create directory "mwstore://local-backend/local-public/3/3d". I ...
Read more >Azure blob storage upload fail - Microsoft Q&A
Uploading files to blob endpoint Azure storage account via Storage Explorer and command line is failing with error "Response Status: 403 ...
Read more >Upload file to blob storage - Error with upload - Stack Overflow
I test it in my asp.net core and it works well. I think you may not get the files you have upload. Please...
Read more >Upload into Container Field - Data API - Error 20402
In our first test where we identified the problem is was on a web portal with dropzone.js where multiple files at once will...
Read more >Upload to container: '$web' in storage account: '' with blob ...
Upload to container: '$web' in storage account: '' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I also have the following dependencies connected:
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!