mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-26 08:45:19 -04:00
cli: allow manual patch of attestation policy
This commit is contained in:
parent
46afb07ccf
commit
d4c0213f60
1 changed files with 6 additions and 2 deletions
|
@ -6,6 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
package cloudcmd
|
package cloudcmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -55,10 +56,13 @@ func (p AzurePolicyPatcher) Patch(ctx context.Context, attestationURL string) er
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("sending request: %w", err)
|
return fmt.Errorf("sending request: %w", err)
|
||||||
}
|
}
|
||||||
resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
return fmt.Errorf("updating attestation policy: unexpected status code: %s", resp.Status)
|
buf := new(bytes.Buffer)
|
||||||
|
_, _ = buf.ReadFrom(resp.Body)
|
||||||
|
fmt.Printf("updating attestation policy: unexpected status code: %s with message %q", resp.Status, buf.String())
|
||||||
|
fmt.Println("Patching the attestations policy failed. Please patch the policy manually before continuing to initialize the cluster.")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue