-
Notifications
You must be signed in to change notification settings - Fork 551
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I saw in documentation that jkube.enricher.jkube-name.name
is supposed to override "Add a default name to every object which misses a name."
When I have 2 pods fragments such as :
src/main/jkube/test-health.yml
apiVersion: v1
kind: Pod
metadata:
namespace: mynamespace
name: myapp-test-health
spec:
...
and src/main/jkube/test-metrics.yml
apiVersion: v1
kind: Pod
metadata:
namespace: mynamespace
name: myapp-test-metrics
spec:
...
And I set this config in my pom.xml
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${jkube.version}</version>
<configuration>
<enricher>
<config>
<jkube-name>
<name>myapp</name>
</jkube-name>
<jkube-well-known-labels>
<name>myapp</name>
</jkube-well-known-labels>
</config>
</enricher>
</configuration>
</plugin>
The result after build is that I get 2 files named : myapp-pod.yaml
and myapp-1-pod.yaml
having exactly the same name (set in the pom.xml
) :
apiVersion: v1
kind: Pod
metadata:
namespace: mynamespace
name: myapp
spec:
...
Eclipse JKube version
1.16.1
Component
Kubernetes Maven Plugin
Apache Maven version
3.8.5
Gradle version
None
Steps to reproduce
- Create a pod fragment files with a name :
apiVersion: v1
kind: Pod
metadata:
namespace: mynamespace
name: myapp-test
spec:
...
- Override the property
jkube.enricher.jkube-name.name
in thepom.xml
:
<enricher>
<config>
<jkube-name>
<name>myapp</name>
</jkube-name>
</config>
</enricher>
- Build the project using :
./mvnw k8s:resource k8s:helm
- Check in your target the generated yaml file
myapp-pod.yaml
, you will see that the name was changed :
apiVersion: v1
kind: Pod
metadata:
namespace: mynamespace
name: myapp
spec:
...
Expected behavior
If a name is set in the fragment, keep the name, if not, override it.
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3
Environment
macOS
Eclipse JKube Logs
No response
Sample Reproducer Project
No response
Additional context
No response
ajeans
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working