[go: nahoru, domu]

Skip to content

Commit

Permalink
add instance id dir override (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
hopkiw committed Sep 28, 2020
1 parent 3d1a9b2 commit bf82f7c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions google_guest_agent/instance_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ import (
"github.com/go-ini/ini"
)

const (
instanceIDFile = "/etc/google_instance_id"
)

func agentInit(ctx context.Context) {
// Actions to take on agent startup.
//
Expand Down Expand Up @@ -155,6 +151,7 @@ func agentInit(ctx context.Context) {
// Check if instance ID has changed, and if so, consider this
// the first boot of the instance.
// TODO Also do this for windows. liamh@13-11-2019
instanceIDFile := config.Section("Instance").Key("instance_id_dir").MustString("/etc") + "/google_instance_id"
instanceID, err := ioutil.ReadFile(instanceIDFile)
if err != nil && !os.IsNotExist(err) {
logger.Warningf("Not running first-boot actions, error reading instance ID: %v", err)
Expand Down

0 comments on commit bf82f7c

Please sign in to comment.