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

issue parsing volumemounts to deployment.yml #1783

Open
narsi-nallamilli opened this issue Feb 4, 2020 · 1 comment
Open

issue parsing volumemounts to deployment.yml #1783

narsi-nallamilli opened this issue Feb 4, 2020 · 1 comment
Labels
status/never-stale Pin this issue to get never marked as stale by stale-bot

Comments

@narsi-nallamilli
Copy link

narsi-nallamilli commented Feb 4, 2020

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]
@stale
Copy link

stale bot commented May 4, 2020

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!

@stale stale bot added the status/stale Issue/PR considered to be stale label May 4, 2020
@rohanKanojia rohanKanojia added the status/never-stale Pin this issue to get never marked as stale by stale-bot label May 5, 2020
@stale stale bot removed the status/stale Issue/PR considered to be stale label May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/never-stale Pin this issue to get never marked as stale by stale-bot
Projects
None yet
Development

No branches or pull requests

2 participants