-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename Status action to io.cnab.status Remove Downgrade action Signed-off-by: Guillaume Lours <[email protected]>
- Loading branch information
Showing
6 changed files
with
76 additions
and
125 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,66 @@ | ||
package action | ||
|
||
import ( | ||
"github.com/deislabs/cnab-go/claim" | ||
"github.com/deislabs/cnab-go/credentials" | ||
"github.com/deislabs/cnab-go/driver" | ||
) | ||
|
||
// Well known constants define the Well Know CNAB action to be taken | ||
const ( | ||
ActionDryRun = "io.cnab.dry-run" | ||
ActionHelp = "io.cnab.help" | ||
ActionLog = "io.cnab.log" | ||
ActionStatus = "io.cnab.status" | ||
ActionStatusJSON = "io.cnab.status+json" | ||
) | ||
|
||
// DryRun runs a dry-run action on a CNAB bundle. | ||
type DryRun struct { | ||
Driver driver.Driver | ||
} | ||
|
||
// Help runs a help action on a CNAB bundle. | ||
type Help struct { | ||
Driver driver.Driver | ||
} | ||
|
||
// Log runs a log action on a CNAB bundle. | ||
type Log struct { | ||
Driver driver.Driver | ||
} | ||
|
||
// Status runs a status action on a CNAB bundle. | ||
type Status struct { | ||
Driver driver.Driver | ||
} | ||
|
||
// StatusJSON runs a status+JSON action on a CNAB bundle. | ||
type StatusJSON struct { | ||
Driver driver.Driver | ||
} | ||
|
||
// Run executes a dry-run action in an image | ||
func (i *DryRun) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error { | ||
return (&RunCustom{Driver: i.Driver, Action: ActionDryRun}).Run(c, creds, opCfgs...) | ||
} | ||
|
||
// Run executes a help action in an image | ||
func (i *Help) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error { | ||
return (&RunCustom{Driver: i.Driver, Action: ActionHelp}).Run(c, creds, opCfgs...) | ||
} | ||
|
||
// Run executes a status action in an image | ||
func (i *Log) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error { | ||
return (&RunCustom{Driver: i.Driver, Action: ActionLog}).Run(c, creds, opCfgs...) | ||
} | ||
|
||
// Run executes a status action in an image | ||
func (i *Status) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error { | ||
return (&RunCustom{Driver: i.Driver, Action: ActionStatus}).Run(c, creds, opCfgs...) | ||
} | ||
|
||
// Run executes a status+JSON action in an image | ||
func (i *StatusJSON) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error { | ||
return (&RunCustom{Driver: i.Driver, Action: ActionStatusJSON}).Run(c, creds, opCfgs...) | ||
} |
This file contains 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,8 @@ | ||
package action | ||
|
||
// makes sure DryRun, Help, Log, Status, StatusJSON implements Action interface | ||
var _ Action = &DryRun{} | ||
var _ Action = &Help{} | ||
var _ Action = &Log{} | ||
var _ Action = &Status{} | ||
var _ Action = &StatusJSON{} |
This file contains 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