-
Notifications
You must be signed in to change notification settings - Fork 13
Add pivot.service as a host API #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ pivot | |
| *.out | ||
| # editor | ||
| .vscode | ||
|
|
||
| systemd/pivot.service | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| %define debug_package %{nil} | ||
|
|
||
| Name: pivot | ||
| Version: 0.0.2 | ||
| Release: 0.1%{?dist} | ||
| Version: 0.0.3 | ||
| Release: 1%{?dist} | ||
| Summary: allows moving from one OSTree deployment to another | ||
|
|
||
| License: ASL 2.0 | ||
|
|
@@ -21,7 +21,7 @@ deployment to another with minimal effort. | |
| %prep | ||
| %autosetup -n %{name}-%{version} | ||
| mkdir -p src/github.com/openshift/%{name}/ | ||
| cp -rf cmd Gopkg.lock Gopkg.toml LICENSE main.go Makefile pivot.spec README.md types utils vendor VERSION src/github.com/openshift/%{name} | ||
| cp -rf cmd Gopkg.lock Gopkg.toml LICENSE main.go Makefile pivot.spec README.md types utils vendor VERSION systemd src/github.com/openshift/%{name} | ||
|
|
||
| %build | ||
| export GOPATH=`pwd` | ||
|
|
@@ -36,9 +36,12 @@ make install DESTDIR=%{buildroot} | |
| %license LICENSE | ||
| %doc README.md | ||
| %{_bindir}/%{name} | ||
|
|
||
| %{_prefix}/lib/systemd/system/pivot.* | ||
|
|
||
| %changelog | ||
| * Tue Feb 05 2019 Jonathan Lebon <[email protected]> - 0.0.3-1 | ||
| - Add systemd service unit | ||
|
|
||
| * Wed Nov 14 2018 Steve Milner <[email protected]> - 0.0.2-0.1 | ||
| - Makefile: Add changelog target | ||
| - cmd/root: Print pivoting msg before pull | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [Unit] | ||
| Description=Pivot Tool | ||
| ConditionPathExists=/etc/pivot/image-pullspec | ||
| After=ignition-firstboot-complete.service | ||
| Before=kubelet.service | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| ExecStart=@@PIVOT_BINARY_PATH@@ | ||
cgwalters marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package utils | ||
|
|
||
| import ( | ||
| "os" | ||
|
|
||
| "github.com/golang/glog" | ||
| ) | ||
|
|
||
| // FileExists checks if the file exists, gracefully handling ENOENT. | ||
| func FileExists(path string) bool { | ||
| if _, err := os.Stat(path); err != nil { | ||
| if os.IsNotExist(err) { | ||
| return false | ||
| } | ||
| glog.Fatalf("Failed to stat %s: %v", path, err) | ||
| } | ||
| return true | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.