Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

ccv new version not published #61

Open
Baefisch opened this issue Dec 14, 2018 · 11 comments
Open

ccv new version not published #61

Baefisch opened this issue Dec 14, 2018 · 11 comments

Comments

@Baefisch
Copy link

Baefisch commented Dec 14, 2018

hello, i try to publish & promote my ccv automatically. For CV´s it works. But for CCV´s no new version would be published. Where is my mistake?

`---
:settings:
:user: admin
:pass:
:uri: https://lnx-rbg40.int.osram-light.com
:timeout: 300
:org: 1
:lifecycle: 7
:keep: 5
:checkrepos: true
:promote_cvs: true

:ccv:
ccv-rhel7-base:
cv-rhel7: latest
cv-rhel7-tools: latest

:publish:

  • cv-rhel7-tools
  • cv-rhel7
  • ccv-rhel7-base

:promote:

  • ccv-rhel7-base`
@rogermeletta
Copy link

we have the same issue on satellite 6.4

@techsolo
Copy link
Contributor

In Satellite 6.4 latest seems to be ignored and the one selected in the web UI is used instead. Any pointers?

@techsolo
Copy link
Contributor

@evgeni I asked on IRC already and also made a ticket at Red Hat. Can you have a look or help me to find someone who can help to get this solved?

@Rocco83
Copy link
Contributor

Rocco83 commented Mar 13, 2019

@techsolo @RogerTanner have you tried out #53 ?

@techsolo
Copy link
Contributor

I currently don't work for a company with a Satellite, so I can't validate on this. But I am actually pretty sure that I pulled your fork and tested again with the same result.

@fjcloud
Copy link

fjcloud commented Mar 15, 2019

I had the same issue and i resolved it by unset "latest" and set a fixed version of content view in CCV.

@techsolo
Copy link
Contributor

I had the same issue and i resolved it by unset "latest" and set a fixed version of content view in CCV.

Check the result you always get that fixed version, never 'latest'.

@arusso
Copy link

arusso commented Apr 23, 2019

Looks like when one sets a component cv in a ccv to latest, Satellite will always return the latest version of the unpublished ccv rather than the version of the last published version. As a result, cvmanager can't determine that the cv has changed and wont re-publish the ccv.

If cvmanager would check the versions of the last published version of the ccv and not the current versions of the unpublished ccv, this should resolve this issue. Until then you can change the latest value in the ccv to any specific version and let cvmanager manage things, as others have found.

@arusso
Copy link

arusso commented Apr 23, 2019

Came up with a patch to fix this if all you want is things to promote properly even when a component version is set to latest in the UI.

If there's interest I'll stick it behind a feature flag, clean up the output to be more accurate, and put in an MR to get that merged.

diff --git a/cvmanager b/cvmanager
index c9d01f3..69c5a09 100755
--- a/cvmanager
+++ b/cvmanager
@@ -293,9 +293,12 @@ def update()
         puts_verbose "  Found #{desired_version} as the 'latest' version"
       end

-      # if the version of the component does not match the one the user requested update it
-      if component['version'].to_s != desired_version.to_s
-        puts "  Updating from #{component['version']} to #{desired_version}"
+      # if the component version in the most recently published composite version does not match the one the user requested update it
+      ccv_latest_version = ccv['versions'].select { |obj| obj['version'] == ccv['latest_version'] }.first
+      component_cvv = @api.resource(:content_view_versions).call(:index, {:composite_version_id => ccv_latest_version['id'], :organization_id => @options[:org], :content_view_id => component['content_view']['id'] })
+      component_cvv_version = component_cvv['results'].first['version']
+      if component_cvv_version != desired_version.to_s
+        puts "  Updating from #{component_cvv_version} to #{desired_version}"
         oldids = ids.dup
         ids.delete(component['id'])
         cvversions = @api.resource(:content_view_versions).call(:index, {:content_view_id => component['content_view']['id'], :version => desired_version})

@evgeni
Copy link
Member

evgeni commented Apr 23, 2019

@arusso this looks interesting, thanks. Definitely open up a PR for that please.

arusso added a commit to arusso/katello-cvmanager that referenced this issue Apr 26, 2019
arusso added a commit to arusso/katello-cvmanager that referenced this issue Aug 7, 2019
@jgrumboe
Copy link

Is this problem fixed now?

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

No branches or pull requests

8 participants