ref: update code for 2.11 (#2239)

Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com>
This commit is contained in:
Adrian Stobbe 2023-08-16 11:34:58 +02:00 committed by GitHub
parent 103817a4a5
commit 5574092bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 6 additions and 36 deletions

View File

@ -2,7 +2,6 @@ name: Constellation create
description: Create a new Constellation cluster using latest OS image. description: Create a new Constellation cluster using latest OS image.
inputs: inputs:
# TODO(elchead): remove once 2.10 is released
workerNodesCount: workerNodesCount:
description: "Number of worker nodes to spawn." description: "Number of worker nodes to spawn."
required: true required: true
@ -93,8 +92,6 @@ runs:
yq eval -i "(.nodeGroups[] | .instanceType) = \"${{ inputs.machineType }}\"" constellation-conf.yaml yq eval -i "(.nodeGroups[] | .instanceType) = \"${{ inputs.machineType }}\"" constellation-conf.yaml
- name: Set node count - name: Set node count
# TODO(katexochen): remove if statement once 2.10 is released.
if: inputs.cliVersion != 'v2.9.0' && inputs.cliVersion != 'v2.9.1'
shell: bash shell: bash
run: | run: |
yq eval -i "(.nodeGroups[] | select(.role == \"control-plane\") | .initialCount) = ${{ inputs.controlNodesCount }}" constellation-conf.yaml yq eval -i "(.nodeGroups[] | select(.role == \"control-plane\") | .initialCount) = ${{ inputs.controlNodesCount }}" constellation-conf.yaml
@ -115,13 +112,7 @@ runs:
echo "Creating cluster using config:" echo "Creating cluster using config:"
cat constellation-conf.yaml cat constellation-conf.yaml
sudo sh -c 'echo "127.0.0.1 license.confidential.cloud" >> /etc/hosts' || true sudo sh -c 'echo "127.0.0.1 license.confidential.cloud" >> /etc/hosts' || true
constellation create -y --force --debug --tf-log=DEBUG
output=$(constellation --help)
if [[ $output == *"tf-log"* ]]; then
TFFLAG="--tf-log=DEBUG"
fi
constellation create -y --force --debug ${TFFLAG:-} -c ${{ inputs.controlNodesCount }} -w ${{ inputs.workerNodesCount }}
# TODO(elchead): remove -c and -w once 2.10 is released, such that a fromVersion upgrade E2E no longer requires these flags
- name: Cdbg deploy - name: Cdbg deploy
if: inputs.isDebugImage == 'true' if: inputs.isDebugImage == 'true'

View File

@ -41,8 +41,4 @@ runs:
- name: Constellation terminate - name: Constellation terminate
shell: bash shell: bash
run: | run: |
output=$(constellation --help) constellation terminate --yes --tf-log=DEBUG
if [[ $output == *"tf-log"* ]]; then
TFFLAG="--tf-log=DEBUG"
fi
constellation terminate --yes ${TFFLAG:-}

View File

@ -39,8 +39,4 @@ runs:
- name: Delete IAM configuration - name: Delete IAM configuration
shell: bash shell: bash
run: | run: |
output=$(constellation --help) constellation iam destroy --yes --tf-log=DEBUG
if [[ $output == *"tf-log"* ]]; then
TFFLAG="--tf-log=DEBUG"
fi
constellation iam destroy --yes ${TFFLAG:-}

View File

@ -233,7 +233,7 @@ jobs:
fail-fast: false fail-fast: false
max-parallel: 1 max-parallel: 1
matrix: matrix:
fromVersion: ["v2.9.1"] fromVersion: ["v2.10.0"]
cloudProvider: ["gcp", "azure", "aws"] cloudProvider: ["gcp", "azure", "aws"]
name: Run upgrade tests name: Run upgrade tests
secrets: inherit secrets: inherit

View File

@ -251,7 +251,7 @@ jobs:
fail-fast: false fail-fast: false
max-parallel: 1 max-parallel: 1
matrix: matrix:
fromVersion: ["v2.9.1"] fromVersion: ["v2.10.0"]
cloudProvider: ["gcp", "azure", "aws"] cloudProvider: ["gcp", "azure", "aws"]
name: Run upgrade tests name: Run upgrade tests
secrets: inherit secrets: inherit

View File

@ -22,8 +22,6 @@ import (
func upgradeRequiresIAMMigration(provider cloudprovider.Provider) bool { func upgradeRequiresIAMMigration(provider cloudprovider.Provider) bool {
switch provider { switch provider {
case cloudprovider.AWS:
return true // needs to be set on every release. Can we automate this?
default: default:
return false return false
} }

View File

@ -151,17 +151,6 @@ func (u *upgradeApplyCmd) upgradeApply(cmd *cobra.Command) error {
if err := u.fileHandler.ReadJSON(constants.ClusterIDsFilename, &idFile); err != nil { if err := u.fileHandler.ReadJSON(constants.ClusterIDsFilename, &idFile); err != nil {
return fmt.Errorf("reading cluster ID file: %w", err) return fmt.Errorf("reading cluster ID file: %w", err)
} }
if idFile.MeasurementSalt == nil {
// TODO(elchead): remove after 2.10, since 2.9 does not yet save it in the idfile
measurementSalt, err := u.kubeUpgrader.GetMeasurementSalt(cmd.Context())
if err != nil {
return fmt.Errorf("getting join-config: %w", err)
}
idFile.MeasurementSalt = measurementSalt
if err := u.fileHandler.WriteJSON(constants.ClusterIDsFilename, idFile, file.OptOverwrite); err != nil {
return fmt.Errorf("writing cluster ID file: %w", err)
}
}
conf.UpdateMAAURL(idFile.AttestationURL) conf.UpdateMAAURL(idFile.AttestationURL)
if err := u.confirmIfUpgradeAttestConfigHasDiff(cmd, conf.GetAttestationConfig(), flags); err != nil { if err := u.confirmIfUpgradeAttestConfigHasDiff(cmd, conf.GetAttestationConfig(), flags); err != nil {

View File

@ -1 +1 @@
v2.10.0-pre v2.11.0-pre