Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

issue parsing volumemounts to deployment.yml #1783

@narsi-nallamilli

Description

@narsi-nallamilli

Description

fmp is not parsing VolumeMounts specified in resources as specified in https://maven.fabric8.io/#fabric8:resource

Info

fmp is not translating volumenMounts specified in resources into deployment.yml it is ignoring it.

  • f-m-p version : 4.3.1
  • Maven version (mvn -v) : 3.6.1
  • Kubernetes / OpenShift setup and version : Openshift
  • If it's a bug, how to reproduce :
    Create a maven project with below pom.xml and execute mvn fabric8:resource
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.example</groupId>
    <artifactId>testbugfmp</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.4.RELEASE</version>
    </parent>
    <dependencies>
        <!-- https://mvnrepository.com/artifact/log4j/log4j -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>fabric8-maven-plugin</artifactId>
                <version>4.3.1</version>
                <configuration>
                    <buildStrategy>docker</buildStrategy>
                    <switchToDeployment>false</switchToDeployment>
                    <imagePullPolicy>Always</imagePullPolicy>
                    <resources>
                        <volumes>
                            <volume>
                                <name>work</name>
                                <type>emptyDir</type>
                            </volume>
                        </volumes>
                        <labels>
                            <deployment>
                                <containers>
                                    <container>
                                        <mounts>
                                            <scratch>/var/scratch</scratch>
                                        </mounts>
                                    </container>
                                </containers>
                            </deployment>
                        </labels>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

You will see the openshift deployment.yml created without volumeMount which is expected.

---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  annotations:
    fabric8.io/scm-url: https://github.com/spring-projects/spring-boot/spring-boot-starter-parent/testbugfmp
    fabric8.io/scm-tag: HEAD
  labels:
    app: testbugfmp
    provider: fabric8
    version: 1.0-SNAPSHOT
    group: org.example
  name: testbugfmp
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    app: testbugfmp
    provider: fabric8
    group: org.example
  strategy:
    rollingParams:
      timeoutSeconds: 3600
    type: Rolling
  template:
    metadata:
      annotations:
        fabric8.io/scm-tag: HEAD
        fabric8.io/scm-url: https://github.com/spring-projects/spring-boot/spring-boot-starter-parent/testbugfmp
      labels:
        app: testbugfmp
        provider: fabric8
        version: 1.0-SNAPSHOT
        group: org.example
    spec:
      containers:
      - env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: testbugfmp:latest
        imagePullPolicy: IfNotPresent
        name: spring-boot
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 9779
          name: prometheus
          protocol: TCP
        - containerPort: 8778
          name: jolokia
          protocol: TCP
        securityContext:
          privileged: false
      volumes:
      - emptyDir: {}
        name: work
  triggers:
  - type: ConfigChange
  - imageChangeParams:
      automatic: true
      containerNames:
      - spring-boot
      from:
        kind: ImageStreamTag
        name: testbugfmp:latest
    type: ImageChange
  • If it's a feature request, what is your use case :
  • Sample project : [GitHub Clone URL]

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/never-stalePin this issue to get never marked as stale by stale-bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions