Skip to content

Commit

Permalink
Merge remote-tracking branch 'fork/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sevagh committed Aug 14, 2023
2 parents 6fce5c6 + 114218b commit 14774e9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 1.0.3 (August 14, 2019)

BUG FIXES:
- NVME volumes now mount correctly
- Previously attached volumes are no longer skipped
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME:=goat
VERSION:=$(shell git describe --tags)
VERSION:=$(shell git describe --tags|sed 's/^v//')
OS:=linux
ARCH:=amd64
GOAT_FILES:=$$(find . -name '*.go' | grep -v vendor)
Expand Down
5 changes: 3 additions & 2 deletions ebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
log "github.com/sirupsen/logrus"
"os"
"os/exec"
"strconv"
"syscall"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
Expand Down Expand Up @@ -120,7 +120,8 @@ func prepAndMountDrives(volName string, vols []EbsVol) {
}

driveLogger.Info("Now mounting")
if err := syscall.Mount("", mountPath, "", 0, ""); err != nil {
cmd := exec.Command("mount", mountPath)
if err := cmd.Run(); err != nil {
driveLogger.Fatalf("Couldn't mount: %v", err)
}

Expand Down
4 changes: 3 additions & 1 deletion ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ type EC2Instance struct {
//GetEC2InstanceData returns a populated EC2Instance struct with the current EC2 instances' metadata
func GetEC2InstanceData(tagPrefix string) EC2Instance {
var ec2Instance EC2Instance
sess := session.New()
sess := session.New(&aws.Config{
MaxRetries: aws.Int(5),
})

creds := credentials.NewCredentials(
&ec2rolecreds.EC2RoleProvider{
Expand Down
2 changes: 2 additions & 0 deletions rpm/goat.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TAG_PREFIX=GOAT-IN
LOG_LEVEL=info
11 changes: 7 additions & 4 deletions rpm/goat@.service
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
[Unit]
Description=GOAT: EC2-%i attach utility
Documentation=https://github.com/sevagh/goat
Requires=network.target remote-fs.target
After=network.target remote-fs.target
Requires=network.target
After=network.target
After=NetworkManager-wait-online.service
Before=cloud-init.service
ConditionPathExists=/usr/sbin/goat

[Service]
EnvironmentFile=/etc/sysconfig/goat
Type=oneshot
User=root
Group=root
ExecStart=/usr/sbin/goat "%i"
ExecStart=/usr/sbin/goat -tagPrefix ${TAG_PREFIX} -logLevel ${LOG_LEVEL} "%i"
SyslogIdentifier=goat

[Install]
WantedBy=multi-user.target
WantedBy=cloud-init.target
10 changes: 8 additions & 2 deletions rpm/specfile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ License: BSD 3-clause
URL: https://github.com/sevagh/goat
Source0: %{pkgname}
Source1: %{pkgname}@.service
Source2: %{pkgname}.cfg

Requires: systemd mdadm

Expand All @@ -25,11 +26,14 @@ Automatically attach AWS resources to a running EC2 instance.
%install
%{__mkdir} -p %{buildroot}/%{_sbindir}
%{__mkdir} -p %{buildroot}/%{_unitdir}
%{__mkdir} -p %{buildroot}/%{_sysconfdir}/sysconfig
%{__install} -m0775 %{SOURCE0} %{buildroot}/%{_sbindir}/%{pkgname}
%{__install} -m0777 %{SOURCE1} %{buildroot}/%{_unitdir}/%{pkgname}@.service
%{__install} -m0644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{pkgname}@.service
%{__install} -m0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/sysconfig/%{pkgname}


%files
%config(noreplace) /etc/sysconfig/goat
%{_sbindir}/%{pkgname}
%{_unitdir}/%{pkgname}@.service

Expand All @@ -53,11 +57,13 @@ fi


%changelog
* Wed Sep 25 2019 Andrew Cutler <andrew@panubo.com>
- Add configuration file
* Tue Apr 17 2018 Sevag Hanssian <sevag.hanssian@gmail.com>
- Recombine commands
* Tue Mar 06 2018 Sevag Hanssian <sevag.hanssian@gmail.com>
- Split subcommands into two binaries
* Thu Aug 10 2017 Sevag Hanssian <sevag.hanssian@gmail.com>
- Goat subcommands
* Tue Jul 11 2017 Sevag Hanssian <sevag.hanssian@gmail.com>
- First RPM package for goat
- First RPM package for goat

0 comments on commit 14774e9

Please sign in to comment.