Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Display info when there is no change in local source #233

Merged
rashedkvm merged 1 commit into
vmware-tanzu:mainfrom
shashwathi:iss-175
Jul 25, 2022
Merged

Display info when there is no change in local source #233
rashedkvm merged 1 commit into
vmware-tanzu:mainfrom
shashwathi:iss-175

Conversation

@shashwathi
Copy link
Copy Markdown
Contributor

Pull request

What this PR does / why we need it

when the local source hasnt changed, display info No sourc code is changed, instead of Published source.

Which issue(s) this PR fixes

Fixes #175

Describe testing done for PR

case when no change in code + no change in spec

% tanzu apps workload apply pet-img-6 --source-image gcr.io/SOMETHING/petclinictestjar:source --local-path /Users/snagarajared/workspace/spring-petclinic/target/spring-petclinic-2.6.0-SNAPSHOT.jar  
? Publish source in "/Users/snagarajared/workspace/spring-petclinic/target/spring-petclinic-2.6.0-SNAPSHOT.jar" to "gcr.io/SOMETHINGpetclinictestjar:source"? It may be visible to others who can pull images from that repository Yes
Publishing source in "/Users/snagarajared/workspace/spring-petclinic/target/spring-petclinic-2.6.0-SNAPSHOT.jar" to "gcr.io/SOMETHING/petclinictestjar:source"...
No source code is changed
Workload is unchanged, skipping update

case when no change in code + change in spec

tanzu apps workload apply pet-img-6 --source-image gcr.io/SOMETHING/petclinictestjar:source --local-path /Users/snagarajared/workspace/spring-petclinic/target/spring-petclinic-2.6.0-SNAPSHOT.jar  --label type=web
? Publish source in "/Users/snagarajared/workspace/spring-petclinic/target/spring-petclinic-2.6.0-SNAPSHOT.jar" to "gcr.io/SOMETHING/petclinictestjar:source"? It may be visible to others who can pull images from that repository Yes
Publishing source in "/Users/snagarajared/workspace/spring-petclinic/target/spring-petclinic-2.6.0-SNAPSHOT.jar" to "gcr.io/SOMETHING/petclinictestjar:source"...
No source code is changed
Update workload:
  1,  1   |---
  2,  2   |apiVersion: carto.run/v1alpha1
  3,  3   |kind: Workload
  4,  4   |metadata:
      5 + |  labels:
      6 + |    type: web
  5,  7   |  name: pet-img-6
  6,  8   |  namespace: default
  7,  9   |spec:
  8, 10   |  source:
...

? Really update the workload "pet-img-6"? Yes
Updated workload "pet-img-6"

To see logs:   "tanzu apps workload tail pet-img-6"
To get status: "tanzu apps workload get pet-img-6"

- if the source code hasnt changed then display info `No sourc code is changed`, instead of
`Published source`

Signed-off-by: Shash Reddy <snagarajared@vmware.com>
Copy link
Copy Markdown
Member

@rashedkvm rashedkvm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Is the intent for #175 to prevent pushing the source image when there is no change in the source? Is that no longer in the scope? According to this PR, apps plugin will push the image and does not prevent it when there is no source change. Please see

digestedImage, err := source.ImgpkgPush(ctx, contentDir, fileExclusions, taggedImage)

@shashwathi
Copy link
Copy Markdown
Contributor Author

Is the intent for #175 to prevent pushing the source image when there is no change in the source?

When there is no change in source, underlying lib imgpkg is not pushing the blob to registry. The scope was changed to update the msging to indicate the same.

@rashedkvm
Copy link
Copy Markdown
Member

When there is no change in source, underlying lib imgpkg is not pushing the blob to registry.

Are you sure?

@rashedkvm rashedkvm merged commit 8665eb4 into vmware-tanzu:main Jul 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only update/upload local source when there are changes

4 participants