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

upload-stemcell/checkStemcellUploaded does not detect existing stemcell #615

Open
jzinkweg opened this issue Feb 20, 2024 · 1 comment
Open

Comments

@jzinkweg
Copy link

Describe the bug

Stemcells downloaded using om download-product are prefixed with [name,version] metadata.

The CheckStemcellAvailability method uses the full filename against the listed stemcells from ops manager diagnostic report:

if stemcell.Filename == filepath.Base(stemcellFilename) {

On OpsMan 2.10.58, this does not match as the [metadata] prefix is not listed as part of the filename:

  "available_stemcells": [
    {
      "filename": "bosh-stemcell-1.340-vsphere-esxi-ubuntu-jammy-go_agent.tgz",
      "os": "ubuntu-jammy",
      "version": "1.340"
    },
    {
      "filename": "bosh-stemcell-621.813-vsphere-esxi-ubuntu-xenial-go_agent.tgz",
      "os": "ubuntu-xenial",
      "version": "621.813"
    }
  ],

Note that after upgrading to Opsman 3.0.28, the output in the diagnostic report has changed:

  "available_stemcells": [
    {
      "filename": "bosh-vsphere-esxi-ubuntu-jammy-go_agent-1.340.tgz",
      "os": "ubuntu-jammy",
      "version": "1.340"
    },
    {
      "filename": "bosh-vsphere-esxi-ubuntu-xenial-go_agent-621.813.tgz",
      "os": "ubuntu-xenial",
      "version": "621.813"
    }
  ],

As a result, pushing the same stemcell multiple times leads to multiple uploads.
This causes delays in our automation pipeline as one of our sandbox environments is on an unfortunately tiny internet connection.

Reproduction steps

  1. Download stemcell using om download-product
  2. Upload stemcell for the first time, wait for success
  3. Run upload command again and observe second transfer
toolingbox$  om-linux -t https://opsmanager.example.com/ -c ci-concourse -s secret upload-stemcell --stemcell './[stemcells-ubuntu-jammy,1.340]bosh-stemcell-1.340-vsphere-esxi-ubuntu-jammy-go_agent.tgz'
processing stemcell
beginning stemcell upload to Ops Manager
 1.21 GiB / 1.21 GiB [=============================================] 100.00% 10s
3s elapsed, waiting for response from Ops Manager...
finished upload
toolingbox$  om-linux -t https://opsmanager.example.com/ -c ci-concourse -s secret upload-stemcell --stemcell './[stemcells-ubuntu-jammy,1.340]bosh-stemcell-1.340-vsphere-esxi-ubuntu-jammy-go_agent.tgz'
processing stemcell
beginning stemcell upload to Ops Manager
 1.21 GiB / 1.21 GiB [=============================================] 100.00% 10s
3s elapsed, waiting for response from Ops Manager...
finished upload

Expected behavior

Second upload should be skipped as stemcell already exists.

Additional context

Upload-product checks the presence of the product using the metadata name/version instead of file paths.

@jzinkweg jzinkweg added the bug label Feb 20, 2024
@cf-gitbot
Copy link
Member

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants