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

Multiple subscriptions use case with Image and Git #1313

Closed
geowalrus4gh opened this issue Dec 21, 2023 · 5 comments
Closed

Multiple subscriptions use case with Image and Git #1313

geowalrus4gh opened this issue Dec 21, 2023 · 5 comments

Comments

@geowalrus4gh
Copy link

geowalrus4gh commented Dec 21, 2023

Description

What exactly is happening when I configure multiple subscriptions - one with image and another with git, as given below?

  `kind: Warehouse
  metadata:
    name: kargo-demo
    namespace: kargo-demo
  spec:
    subscriptions:
    - image:
        repoURL: xyz/kargo-demo-app
        semverConstraint: ^0.1.0
    - image:
        repoURL: xyz/kargo-show-app
        semverConstraint: ^0.0.0
    - git:
        repoURL: https://github.com/xyz/kargo-demo-deploy.git`

And I have a stage promotion as follows.

  `apiVersion: kargo.akuity.io/v1alpha1
  kind: Stage
  metadata:
    name: test
    namespace: kargo-demo
  spec:
    subscriptions:
      warehouse: kargo-demo
    promotionMechanisms:
      gitRepoUpdates:
      - repoURL: https://github.com/xyz/kargo-demo-deploy.git
        writeBranch: stage/test
        helm:
          images:
            - image: xyz/kargo-demo-app
              valuesFilePath: helm/stages/test/values.yaml
              key: "kargo-demo-app-charts.image.tag"
              value: Tag
            - image: xyz/kargo-show-app
              valuesFilePath: helm/stages/test/values.yaml
              key: "kargo-show-app-charts.image.tag"
              value: Tag
  
      argoCDAppUpdates:
      - appName: kargo-demo-test
        appNamespace: argocd
  `

Here, updates coming to the git repository is able to promote. But when a new image is released and promoted from kargo, its not taking effect. Target 'test' branch is not getting updated with the latest released image. I suspect the update being overridden by the old version in the master branch.

Any pointers ? or is it an invalid configuration?

Logs

No relevant logs

@krancour
Copy link
Member

@geowalrus4gh the keys in your values files look suspicious to me...

@geowalrus4gh
Copy link
Author

geowalrus4gh commented Dec 23, 2023

Here is the values.yaml

globals:
  kargo-demo-app-charts:
    enabled: true

kargo-demo-app-charts:
  image:
    tag: "0.1.20"
  replicaCount: 1
kargo-show-app-charts:
  image:
    tag: "0.0.3"
  replicaCount: 1

I was testing promotion use cases for both versions via 'image. tag' and git commit updates (eg replicaCount )

Additional Info

The chart deployment.yaml refers image repository as follows

 image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"

values.yaml inside the chart as follows

 image:
   repository: xyz/kargo-demo-app

@krancour
Copy link
Member

@geowalrus4gh

It's probably your semver constraints:

    - image:
        repoURL: xyz/kargo-demo-app
        semverConstraint: ^0.1.0
    - image:
        repoURL: xyz/kargo-show-app
        semverConstraint: ^0.0.0

The third-party semver package was recently upgraded and they fixed a bug regarding improper interpretation of the ^ comparison operator for versions < 1.0.0.

It is likely that with this fix, your warehouse cannot select anything newer than xyz/kargo-demo-app:0.1.x and xyz/kargo-show-app:0.0.x.

One of our own teammates was bit by this very issue just last night and that's when it came onto my radar.

References:

If you update those expressions, it will likely solve your problem.

Please lmk if this works.

@geowalrus4gh
Copy link
Author

geowalrus4gh commented Dec 26, 2023

It worked after the change as below.

  spec:
    subscriptions:
    - image:
        repoURL: xyz/kargo-demo-app
        semverConstraint: ^0
    - image:
        repoURL: xyz/kargo-show-app
        semverConstraint: ^0
    - git:
        repoURL: https://github.com/xyz/kargo-demo-deploy.git

thanks @krancour . would be helpful if the same is documented or a link to Semver site.

@krancour
Copy link
Member

Opened #1342

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