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

Re-open: Component version issue with OCM #1195

Closed
arjunroy-89 opened this issue Dec 16, 2024 · 2 comments
Closed

Re-open: Component version issue with OCM #1195

arjunroy-89 opened this issue Dec 16, 2024 · 2 comments
Labels
area/ipcei Important Project of Common European Interest kind/feature new feature, enhancement, improvement, extension

Comments

@arjunroy-89
Copy link

arjunroy-89 commented Dec 16, 2024

Hi Team,
Good Day.!

I am creating a new ticket with respect to prior issue report on below ticket
#1172

I have the tried the given suggestion on above ticket, but still no luck.
It failing with same error.
Below is the example of one of component.yaml file format.

  - input:
      type: wget
      url: https://common.repositories.cloud.sap/artifactory/deploy.releases.sapcp/com/sap/cp/trendmicro/20.0.1.23340/trendmicro.tar.gz
    name: trendmicro
    type: blob
    version: 20.0-1.23340

I have added the ubunutu packages as per the given suggestion.

- input:
    type: wget
    url: https://common.repositories.cloud.sap/artifactory/deploy.releases.sapcp/com/sap/cp/gdch/ubuntu-20.04-v20240119-gdch/ubuntu_packages/ubuntu_packages.tar.gz
  name: ubuntu_packages
  type: blob
  version: 20.0-1.23340
  provider:
    name: sap.com
  labels:
    - name: original-version
      value: ubuntu-20.04-v20240119-gdch

Issue still persist.
Getting below error

ocm add cv -c --file ./ctf-for-cf components-backup.yaml
processing components-backup.yaml...
  processing document 1...
    processing index 1
    processing index 2
    processing index 3
    processing index 4
    processing index 5
    processing index 6
    processing index 7
    processing index 8
    processing index 9
    processing index 10
    processing index 51
    processing index 52
    processing index 53
    processing index 54
    processing index 55
    processing index 56
Error: components-backup.yaml: invalid component spec 1[56]: component.version: Does not match pattern '^[v]?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
I751342@GVVCXCYXTK cf-ocm-adapter % 

Please let us know your availability for a team meet to discuss on this issue, It will be feasible for all of us.
Please suggest on this.

@arjunroy-89 arjunroy-89 added the kind/feature new feature, enhancement, improvement, extension label Dec 16, 2024
@github-actions github-actions bot added the area/ipcei Important Project of Common European Interest label Dec 16, 2024
@hilmarf
Copy link
Member

hilmarf commented Dec 16, 2024

As the error states the version doesn't match Strict SemVer Validation.

Maybe this tiny script (semver.sh) could help, turning your versions into semver-compatible ones?

#/bin/bash!

out=( $(grep -Eo '[[:digit:]]+|[^[:digit:]]+' <<<"$1") )

i=0
for element in "${out[@]}"; do
  if [[ $element =~ ^[0-9]+$ ]]; then
    echo -n $element | sed -E 's/^0*([0-9]+)/\1/'
    if [ $i -lt 2 ]; then
      echo -n "."
    fi
    ((i++))
    if [ $i -ge 3 ]; then
      echo -n "-"
      break
    fi
  fi
done

echo $1

Usage:

$ ./semver.sh ubuntu-20.04-v20240119-gdch
20.4.20240119-ubuntu-20.04-v20240119-gdch

$ ./semver.sh 20.0.1.23340
20.0.1-20.0.1.23340

@jakobmoellerdev
Copy link
Contributor

Duplicate of #1172

@jakobmoellerdev jakobmoellerdev marked this as a duplicate of #1172 Dec 17, 2024
@github-project-automation github-project-automation bot moved this from 🆕 ToDo to 🍺 Done in OCM Backlog Board Dec 17, 2024
@ocmbot ocmbot bot moved this from 🍺 Done to 🔒Closed in OCM Backlog Board Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipcei Important Project of Common European Interest kind/feature new feature, enhancement, improvement, extension
Projects
Status: 🔒Closed
Development

No branches or pull requests

3 participants