-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mamezou-tech/0.0.8
v0.0.8 Release
- Loading branch information
Showing
31 changed files
with
740 additions
and
201 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 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 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 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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
module github.com/mamezou-tech/concourse-k8s-resource | ||
|
||
go 1.13 | ||
go 1.14 | ||
|
||
require ( | ||
github.com/aws/aws-lambda-go v1.13.3 // indirect | ||
github.com/spf13/cobra v0.0.5 | ||
github.com/emicklei/go-restful v2.9.5+incompatible | ||
github.com/spf13/cobra v1.1.1 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/stretchr/testify v1.4.0 | ||
k8s.io/api v0.17.0 | ||
k8s.io/apimachinery v0.17.0 | ||
k8s.io/cli-runtime v0.17.0 | ||
k8s.io/client-go v0.17.0 | ||
k8s.io/kubectl v0.17.0 | ||
github.com/stretchr/testify v1.6.1 | ||
k8s.io/api v0.20.1 | ||
k8s.io/apimachinery v0.20.1 | ||
k8s.io/cli-runtime v0.20.1 | ||
k8s.io/client-go v0.20.1 | ||
k8s.io/kubectl v0.20.1 | ||
) |
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 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,45 @@ | ||
package kubectl | ||
|
||
import ( | ||
"github.com/emicklei/go-restful/log" | ||
"github.com/spf13/cobra" | ||
"k8s.io/client-go/util/exec" | ||
"k8s.io/kubectl/pkg/cmd/apply" | ||
"k8s.io/kubectl/pkg/cmd/diff" | ||
cmdutil "k8s.io/kubectl/pkg/cmd/util" | ||
) | ||
|
||
type diffCommandFactory struct{} | ||
|
||
var _ CommandFactory = &diffCommandFactory{} | ||
|
||
func (*diffCommandFactory) create(config *CommandConfig) (commands []*Command, err error) { | ||
factory := createKubectlFactory(config) | ||
|
||
options := diff.NewDiffOptions(config.Streams) | ||
command := &cobra.Command{ | ||
Use: "diff", | ||
DisableFlagsInUseLine: true, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
cmdutil.CheckDiffErr(options.Complete(factory, cmd)) | ||
if err := options.Run(); err != nil { | ||
// exit code == 1 -> there is difference(not error!) | ||
if ee, ok := err.(exec.ExitError); ok && ee.ExitStatus() == 1 { | ||
log.Printf("found difference!") | ||
return | ||
} | ||
// exit with error code(>2) | ||
log.Printf("ERR! %+v", err) | ||
cmdutil.CheckDiffErr(err) | ||
} | ||
}, | ||
} | ||
cmdutil.AddFilenameOptionFlags(command, &options.FilenameOptions, "contains the configuration to diff") | ||
cmdutil.AddServerSideApplyFlags(command) | ||
cmdutil.AddFieldManagerFlagVar(command, &options.FieldManager, apply.FieldManagerClientSideApply) | ||
|
||
setManifestPath(command, config.Params) | ||
|
||
commands = append(commands, &Command{command, []string{}}) | ||
return | ||
} |
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 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 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 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 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 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 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
Oops, something went wrong.