mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-28 00:49:26 -05:00
bd63aa3c6b
sed -i '1i/*\nCopyright (c) Edgeless Systems GmbH\n\nSPDX-License-Identifier: AGPL-3.0-only\n*/\n' `grep -rL --include='*.go' 'DO NOT EDIT'` gofumpt -w .
27 lines
467 B
Go
27 lines
467 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package gcp
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/afero"
|
|
)
|
|
|
|
// Writer implements ConfigWriter.
|
|
type Writer struct {
|
|
fs afero.Afero
|
|
}
|
|
|
|
// WriteGCEConf persists the GCE config on disk.
|
|
func (w *Writer) WriteGCEConf(config string) error {
|
|
if err := w.fs.WriteFile("/etc/gce.conf", []byte(config), 0o644); err != nil {
|
|
return fmt.Errorf("writing gce config: %w", err)
|
|
}
|
|
return nil
|
|
}
|