Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subpath is being removed when updating lsp or source image workload from file #565

Open
2 tasks done
warango4 opened this issue May 15, 2023 · 0 comments · Fixed by #580
Open
2 tasks done

subpath is being removed when updating lsp or source image workload from file #565

warango4 opened this issue May 15, 2023 · 0 comments · Fixed by #580
Assignees
Labels
accepted bug Something isn't working MIGRATED-MIGRATED Migrated to private repo
Milestone

Comments

@warango4
Copy link
Contributor

warango4 commented May 15, 2023

Please fill out the issue checklist below and provide ALL the requested information.

  • I reviewed open and closed Github issues that may be related to my problem.
  • I am reporting a bug that others will be able to reproduce.

Describe the bug

  • After creating a workload using Local Source Proxy with a subpath, if the workload is to be updated from a file using --local-path again, the subpath is removed from the workload specification.
  • After creating a workload using source image with a subpath, if the workload is to be updated from a file using --local-path again, the subpath is removed from the workload specification.
  • If a workload is created from file, with a subpath specified, and then --local-path is specified from flags, the subpath is not being saved in the workload specification.

Expected behavior

A clear and concise description of what you expected to happen.

Steps to Reproduce

  • Create a workload using LSP
tanzu apps workload apply tanzu-java-web-app --local-path . --sub-path path
The files and/or directories listed in the .tanzuignore file are being excluded from the uploaded source code.
Publishing source in "." to "local-source-proxy.tap-local-source-system.svc.cluster.local/source:default-tanzu-java-web-app"...
37.56 kB / 37.56 kB [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 63.15 kB p/s
37.56 kB / 37.56 kB [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 63.14 kB p/s
📥 Published source

🔎 Create workload:
      1 + |---
      2 + |apiVersion: carto.run/v1alpha1
      3 + |kind: Workload
      4 + |metadata:
      5 + |  annotations:
      6 + |    local-source-proxy.apps.tanzu.vmware.com: gcr.io/tanzu-framework-playground/source:default-tanzu-java-web-app@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
      7 + |  labels:
      8 + |    apps.tanzu.vmware.com/workload-type: web
      9 + |  name: tanzu-java-web-app
     10 + |  namespace: default
     11 + |spec:
     12 + |  source:
     13 + |    image: gcr.io/tanzu-framework-playground/source:default-tanzu-java-web-app@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
     14 + |    subPath: path
❓ Do you want to create this workload? [yN]: y
👍 Created workload "tanzu-java-web-app"

To see logs:   "tanzu apps workload tail tanzu-java-web-app --timestamp --since 1h"
To get status: "tanzu apps workload get tanzu-java-web-app"
  • Update the workload to take some fields from a file
cat workload.yaml
apiVersion: carto.run/v1alpha1
kind: Workload
metadata:
  name: tanzu-java-web-app
  labels:
    apps.tanzu.vmware.com/workload-type: web
    app.kubernetes.io/part-of: tanzu-java-web-app
    apps.tanzu.vmware.com/has-tests: "true"
spec:
  params:
    - name: annotations
      value:
        autoscaling.knative.dev/minScale: "2"
  source:
    subpath: my-path
    git:
      url: https://github.com/sample-accelerators/tanzu-java-web-app
      ref:
        branch: main
tanzu apps workload apply tanzu-java-web-app --local-path . -f ~/workload.yaml
❗ WARNING: Configuration file update strategy is changing. By default, provided configuration files will replace rather than merge existing configuration. The change will take place in the January 2024 TAP release (use "--update-strategy" to control strategy explicitly).

The files and/or directories listed in the .tanzuignore file are being excluded from the uploaded source code.
Publishing source in "." to "local-source-proxy.tap-local-source-system.svc.cluster.local/source:default-tanzu-java-web-app"...
37.56 kB / 37.56 kB [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 65.18 kB p/s
37.56 kB / 37.56 kB [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 65.17 kB p/s
No source code is changed

🔎 Update workload:
...
  4,  4   |metadata:
  5,  5   |  annotations:
  6,  6   |    local-source-proxy.apps.tanzu.vmware.com: gcr.io/tanzu-framework-playground/source:default-tanzu-java-web-app@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
  7,  7   |  labels:
      8 + |    app.kubernetes.io/part-of: tanzu-java-web-app
      9 + |    apps.tanzu.vmware.com/has-tests: "true"
  8, 10   |    apps.tanzu.vmware.com/workload-type: web
  9, 11   |  name: tanzu-java-web-app
 10, 12   |  namespace: default
 11, 13   |spec:
     14 + |  params:
     15 + |  - name: annotations
     16 + |    value:
     17 + |      autoscaling.knative.dev/minScale: "2"
 12, 18   |  source:
 13, 19   |    image: gcr.io/tanzu-framework-playground/source:default-tanzu-java-web-app@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
 14     - |    subPath: path
❓ Really update the workload "tanzu-java-web-app"? [yN]:
  • Create a workload using source image
tanzu apps workload apply tanzu-java-web-app --local-path . -s gcr.io/tanzu-framework-playground/java-app --sub-path path
The files and/or directories listed in the .tanzuignore file are being excluded from the uploaded source code.
Publishing source in "." to "gcr.io/tanzu-framework-playground/java-app"...
37.56 kB / 37.56 kB [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 45.88 kB p/s
📥 Published source

🔎 Create workload:
      1 + |---
      2 + |apiVersion: carto.run/v1alpha1
      3 + |kind: Workload
      4 + |metadata:
      5 + |  labels:
      6 + |    apps.tanzu.vmware.com/workload-type: web
      7 + |  name: tanzu-java-web-app
      8 + |  namespace: default
      9 + |spec:
     10 + |  source:
     11 + |    image: gcr.io/tanzu-framework-playground/java-app:latest@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
     12 + |    subPath: path
❓ Do you want to create this workload? [yN]: y
👍 Created workload "tanzu-java-web-app"

To see logs:   "tanzu apps workload tail tanzu-java-web-app --timestamp --since 1h"
To get status: "tanzu apps workload get tanzu-java-web-app"
  • Update the workload to take some fields from file
tanzu apps workload apply tanzu-java-web-app --local-path . -f ~/workload.yaml
❗ WARNING: Configuration file update strategy is changing. By default, provided configuration files will replace rather than merge existing configuration. The change will take place in the January 2024 TAP release (use "--update-strategy" to control strategy explicitly).

The files and/or directories listed in the .tanzuignore file are being excluded from the uploaded source code.
Publishing source in "." to "gcr.io/tanzu-framework-playground/java-app:latest"...
37.56 kB / 37.56 kB [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 55.19 kB p/s
No source code is changed

🔎 Update workload:
...
  2,  2   |apiVersion: carto.run/v1alpha1
  3,  3   |kind: Workload
  4,  4   |metadata:
  5,  5   |  labels:
      6 + |    app.kubernetes.io/part-of: tanzu-java-web-app
      7 + |    apps.tanzu.vmware.com/has-tests: "true"
  6,  8   |    apps.tanzu.vmware.com/workload-type: web
  7,  9   |  name: tanzu-java-web-app
  8, 10   |  namespace: default
  9, 11   |spec:
     12 + |  params:
     13 + |  - name: annotations
     14 + |    value:
     15 + |      autoscaling.knative.dev/minScale: "2"
 10, 16   |  source:
 11, 17   |    image: gcr.io/tanzu-framework-playground/java-app:latest@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
 12     - |    subPath: path
❓ Really update the workload "tanzu-java-web-app"? [yN]:
  • Create a workload from file with a subpath defined and using --local-path
cat workload.yaml
apiVersion: carto.run/v1alpha1
kind: Workload
metadata:
  name: tanzu-java-web-app
  labels:
    apps.tanzu.vmware.com/workload-type: web
    app.kubernetes.io/part-of: tanzu-java-web-app
    apps.tanzu.vmware.com/has-tests: "true"
spec:
  params:
    - name: annotations
      value:
        autoscaling.knative.dev/minScale: "2"
  source:
    subpath: my-path
tanzu apps workload apply -f ~/workload.yaml --local-path .
❗ WARNING: Configuration file update strategy is changing. By default, provided configuration files will replace rather than merge existing configuration. The change will take place in the January 2024 TAP release (use "--update-strategy" to control strategy explicitly).

The files and/or directories listed in the .tanzuignore file are being excluded from the uploaded source code.
Publishing source in "." to "local-source-proxy.tap-local-source-system.svc.cluster.local/source:default-tanzu-java-web-app"...
37.13 kB / 37.56 kB [-------------------------------------------------------------------------------------------------------------------------------------->_] 98.87% 76.01 kB p/s
37.56 kB / 37.56 kB [---------------------------------------------------------------------------------------------------------------------------------------] 100.00% 76.87 kB p/s
📥 Published source

🔎 Create workload:
      1 + |---
      2 + |apiVersion: carto.run/v1alpha1
      3 + |kind: Workload
      4 + |metadata:
      5 + |  annotations:
      6 + |    local-source-proxy.apps.tanzu.vmware.com: gcr.io/tanzu-framework-playground/source:default-tanzu-java-web-app@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
      7 + |  labels:
      8 + |    app.kubernetes.io/part-of: tanzu-java-web-app
      9 + |    apps.tanzu.vmware.com/has-tests: "true"
     10 + |    apps.tanzu.vmware.com/workload-type: web
     11 + |  name: tanzu-java-web-app
     12 + |  namespace: default
     13 + |spec:
     14 + |  params:
     15 + |  - name: annotations
     16 + |    value:
     17 + |      autoscaling.knative.dev/minScale: "2"
     18 + |  source:
     19 + |    image: gcr.io/tanzu-framework-playground/source:default-tanzu-java-web-app@sha256:724bcd14c3a84fc7a918cd8ee7a6a987de1699617a17c5af166e8c689a2becf7
❓ Do you want to create this workload? [yN]:

Screenshots

If applicable, add screenshots to help explain your problem.

Version (Apps plugin version, Version of K8s running on cluster)

Put the output of the following commad

tanzu version && tanzu apps version
version: v0.90.0-alpha.0
buildDate: 2023-04-08
sha: 198b3730
v0.12.0-build.2-dev-9344335a

Environment where the bug was observed (cloud, OS, etc)

MacOS Ventura 13.3.1

Additional context & Relevant Debug Output (Logs, etc)

Workaround for this is to use --sub-path flag while updating the workload if using a yaml file.

@warango4 warango4 added bug Something isn't working needs-triage labels May 15, 2023
@warango4 warango4 self-assigned this May 15, 2023
@atmandhol atmandhol added this to the 0.12.0 milestone May 15, 2023
@atmandhol atmandhol assigned odinnordico and unassigned warango4 May 24, 2023
@warango4 warango4 reopened this Jun 15, 2023
@warango4 warango4 modified the milestones: 0.12.0, 0.13.0 Jun 15, 2023
@heyjcollins heyjcollins added the MIGRATED-MIGRATED Migrated to private repo label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug Something isn't working MIGRATED-MIGRATED Migrated to private repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants