adding an upgrade from ocirepo test
Signed-off-by: Soule BA <bah.soule@gmail.com>
This commit is contained in:
		
							parent
							
								
									686fe58f6e
								
							
						
					
					
						commit
						d1d2d0002e
					
				| 
						 | 
				
			
			@ -463,6 +463,45 @@ jobs:
 | 
			
		|||
          fi
 | 
			
		||||
 | 
			
		||||
          kubectl delete -n helm-system -f config/testdata/$test_name/install.yaml
 | 
			
		||||
      - name: Run upgrade from ocirepo source
 | 
			
		||||
        run: |
 | 
			
		||||
            test_name=upgrade-from-ocirepo-source
 | 
			
		||||
            kubectl -n helm-system apply -f config/testdata/$test_name/install.yaml
 | 
			
		||||
            echo -n ">>> Waiting for expected conditions"
 | 
			
		||||
            count=0
 | 
			
		||||
            until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .Ready=="True"' )" ]; do
 | 
			
		||||
              echo -n '.'
 | 
			
		||||
              sleep 5
 | 
			
		||||
              count=$((count + 1))
 | 
			
		||||
              if [[ ${count} -eq 24 ]]; then
 | 
			
		||||
                echo ' No more retries left!'
 | 
			
		||||
                exit 1
 | 
			
		||||
              fi
 | 
			
		||||
            done
 | 
			
		||||
            echo ' done'
 | 
			
		||||
  
 | 
			
		||||
            # Validate release was installed.
 | 
			
		||||
            REVISION_COUNT=$(helm -n helm-system history -o json $test_name | jq 'length')
 | 
			
		||||
            if [ "$REVISION_COUNT" != 1 ]; then
 | 
			
		||||
              echo -e "Unexpected revision count: $REVISION_COUNT"
 | 
			
		||||
              exit 1
 | 
			
		||||
            fi
 | 
			
		||||
  
 | 
			
		||||
            kubectl -n helm-system apply -f config/testdata/$test_name/upgrade.yaml
 | 
			
		||||
            echo -n ">>> Waiting for expected conditions"
 | 
			
		||||
            count=0
 | 
			
		||||
            until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .Ready=="True"' )" ]; do
 | 
			
		||||
              echo -n '.'
 | 
			
		||||
              sleep 5
 | 
			
		||||
              count=$((count + 1))
 | 
			
		||||
              if [[ ${count} -eq 24 ]]; then
 | 
			
		||||
                echo ' No more retries left!'
 | 
			
		||||
                exit 1
 | 
			
		||||
              fi
 | 
			
		||||
            done
 | 
			
		||||
            echo ' done'
 | 
			
		||||
  
 | 
			
		||||
            kubectl delete -n helm-system -f config/testdata/$test_name/install.yaml
 | 
			
		||||
      - name: Run upgrade fail with uninstall remediation strategy test
 | 
			
		||||
        run: |
 | 
			
		||||
          test_name=upgrade-fail-remediate-uninstall
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1439,7 +1439,9 @@ spec:
 | 
			
		|||
                    minLength: 1
 | 
			
		||||
                    type: string
 | 
			
		||||
                  namespace:
 | 
			
		||||
                    description: Namespace of the referent.
 | 
			
		||||
                    description: |-
 | 
			
		||||
                      Namespace of the referent, defaults to the namespace of the Kubernetes
 | 
			
		||||
                      resource object that contains the reference.
 | 
			
		||||
                    maxLength: 63
 | 
			
		||||
                    minLength: 1
 | 
			
		||||
                    type: string
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,25 @@
 | 
			
		|||
---
 | 
			
		||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
 | 
			
		||||
kind: OCIRepository
 | 
			
		||||
metadata:
 | 
			
		||||
  name: upgrade-from-ocirepo-source
 | 
			
		||||
spec:
 | 
			
		||||
  interval: 30s
 | 
			
		||||
  url: oci://ghcr.io/stefanprodan/charts/podinfo
 | 
			
		||||
  ref:
 | 
			
		||||
    tag: 6.6.0
 | 
			
		||||
---
 | 
			
		||||
apiVersion: helm.toolkit.fluxcd.io/v2beta2
 | 
			
		||||
kind: HelmRelease
 | 
			
		||||
metadata:
 | 
			
		||||
  name: upgrade-from-ocirepo-source
 | 
			
		||||
spec:
 | 
			
		||||
  chartRef:
 | 
			
		||||
    kind: OCIRepository
 | 
			
		||||
    name: upgrade-from-ocirepo-source
 | 
			
		||||
  interval: 30s
 | 
			
		||||
  values:
 | 
			
		||||
    resources:
 | 
			
		||||
      requests:
 | 
			
		||||
        cpu: 100m
 | 
			
		||||
        memory: 64Mi
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
---
 | 
			
		||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
 | 
			
		||||
kind: OCIRepository
 | 
			
		||||
metadata:
 | 
			
		||||
  name: upgrade-from-ocirepo-source
 | 
			
		||||
spec:
 | 
			
		||||
  interval: 30s
 | 
			
		||||
  url: oci://ghcr.io/stefanprodan/charts/podinfo
 | 
			
		||||
  ref:
 | 
			
		||||
    tag: 6.6.1
 | 
			
		||||
| 
						 | 
				
			
			@ -546,7 +546,8 @@ string
 | 
			
		|||
</td>
 | 
			
		||||
<td>
 | 
			
		||||
<em>(Optional)</em>
 | 
			
		||||
<p>Namespace of the referent.</p>
 | 
			
		||||
<p>Namespace of the referent, defaults to the namespace of the Kubernetes
 | 
			
		||||
resource object that contains the reference.</p>
 | 
			
		||||
</td>
 | 
			
		||||
</tr>
 | 
			
		||||
</tbody>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue