mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-03-27 19:08:47 +01:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d876c7729 | ||
|
|
70465a0520 | ||
|
|
3c9845719f | ||
|
|
a36cc8946c | ||
|
|
9567b539d1 | ||
|
|
fdf9515de2 | ||
|
|
b320238487 | ||
|
|
7872a60499 | ||
|
|
5fea3846d1 | ||
|
|
86a4e0baaa | ||
|
|
917f1df250 | ||
|
|
11260f2476 | ||
|
|
38d20d0f04 | ||
|
|
938f40e817 | ||
|
|
5f9c8b862e | ||
|
|
d96d67bb9a | ||
|
|
19c3b87676 | ||
|
|
7d08ab4e2b | ||
|
|
efea09d216 | ||
|
|
2adaef547b | ||
|
|
d71bbf0d9a | ||
|
|
36b3b2b853 | ||
|
|
63dafa08cc | ||
|
|
afddbbe875 | ||
|
|
34811cafca |
@@ -58,7 +58,7 @@ FROM golang:1.10 as cli-tooling
|
||||
#RUN go get -v -u github.com/ksonnet/ksonnet && mv ${GOPATH}/bin/ksonnet /ks
|
||||
|
||||
# Option 2: use official tagged ksonnet release
|
||||
env KSONNET_VERSION=0.10.0-alpha.3
|
||||
env KSONNET_VERSION=0.10.1
|
||||
RUN wget https://github.com/ksonnet/ksonnet/releases/download/v${KSONNET_VERSION}/ks_${KSONNET_VERSION}_linux_amd64.tar.gz && \
|
||||
tar -C /tmp/ -xf ks_${KSONNET_VERSION}_linux_amd64.tar.gz && \
|
||||
mv /tmp/ks_${KSONNET_VERSION}_linux_amd64/ks /ks
|
||||
|
||||
@@ -14,7 +14,7 @@ RUN curl -O https://get.docker.com/builds/Linux/x86_64/docker-1.13.1.tgz && \
|
||||
RUN curl -o /usr/local/bin/kubectl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
|
||||
|
||||
# Install ksonnet
|
||||
env KSONNET_VERSION=0.10.0-alpha.3
|
||||
env KSONNET_VERSION=0.10.1
|
||||
RUN wget https://github.com/ksonnet/ksonnet/releases/download/v${KSONNET_VERSION}/ks_${KSONNET_VERSION}_linux_amd64.tar.gz && \
|
||||
tar -C /tmp/ -xf ks_${KSONNET_VERSION}_linux_amd64.tar.gz && \
|
||||
mv /tmp/ks_${KSONNET_VERSION}_linux_amd64/ks /usr/local/bin/ks && \
|
||||
|
||||
30
Gopkg.lock
generated
30
Gopkg.lock
generated
@@ -121,6 +121,7 @@
|
||||
"protoc-gen-gogo/generator",
|
||||
"protoc-gen-gogo/grpc",
|
||||
"protoc-gen-gogo/plugin",
|
||||
"protoc-gen-gogofast",
|
||||
"sortkeys",
|
||||
"vanity",
|
||||
"vanity/command"
|
||||
@@ -156,11 +157,6 @@
|
||||
packages = ["."]
|
||||
revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/google/go-github"
|
||||
packages = ["github"]
|
||||
revision = "996760c56486beb81e91bb7bdb816f8c6f29284e"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/google/go-jsonnet"
|
||||
packages = [
|
||||
@@ -170,12 +166,6 @@
|
||||
]
|
||||
revision = "dfddf2b4e3aec377b0dcdf247ff92e7d078b8179"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/google/go-querystring"
|
||||
packages = ["query"]
|
||||
revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/google/gofuzz"
|
||||
@@ -274,28 +264,21 @@
|
||||
[[projects]]
|
||||
name = "github.com/ksonnet/ksonnet"
|
||||
packages = [
|
||||
"metadata",
|
||||
"metadata/params",
|
||||
"pkg/app",
|
||||
"pkg/component",
|
||||
"pkg/docparser",
|
||||
"pkg/env",
|
||||
"pkg/lib",
|
||||
"pkg/node",
|
||||
"pkg/params",
|
||||
"pkg/parts",
|
||||
"pkg/pkg",
|
||||
"pkg/prototype",
|
||||
"pkg/registry",
|
||||
"pkg/schema",
|
||||
"pkg/util/github",
|
||||
"pkg/util/jsonnet",
|
||||
"pkg/util/kslib",
|
||||
"pkg/util/strings",
|
||||
"pkg/util/yaml"
|
||||
"pkg/util/strings"
|
||||
]
|
||||
revision = "52f89335ef2c7c7015f4ba92cc1ba1e109310c70"
|
||||
version = "v0.10.0-alpha.3"
|
||||
revision = "8c44a5b1545d3d03135f610170ef0167129294bc"
|
||||
version = "v0.10.1"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/ksonnet/ksonnet-lib"
|
||||
@@ -308,7 +291,8 @@
|
||||
"ksonnet-gen/nodemaker",
|
||||
"ksonnet-gen/printer"
|
||||
]
|
||||
revision = "93eeff932dcb550d888dd7fa7e1f7c6a182108fb"
|
||||
revision = "d15220fdcdd07fd377894abff6276d86cb2d776d"
|
||||
version = "v0.1.3"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -781,6 +765,6 @@
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "f0c9d5585cd170dffe4eb0b33241e9d1a0afe7a3065a459e8d1d5998dd22d284"
|
||||
inputs-digest = "8e7142f84554c6f1665ef18e0fb906f82de8cd802b0211c4a46ec1ad228b8b7e"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
required = [
|
||||
"github.com/gogo/protobuf/protoc-gen-gofast",
|
||||
"github.com/gogo/protobuf/protoc-gen-gogofast",
|
||||
"golang.org/x/sync/errgroup",
|
||||
"k8s.io/code-generator/cmd/go-to-protobuf",
|
||||
]
|
||||
@@ -39,7 +40,7 @@ required = [
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/ksonnet/ksonnet"
|
||||
version = "v0.10.0-alpha.3"
|
||||
version = "v0.10.1"
|
||||
|
||||
# override ksonnet's logrus dependency
|
||||
[[override]]
|
||||
|
||||
7
Makefile
7
Makefile
@@ -101,6 +101,11 @@ controller-image:
|
||||
docker build --build-arg BINARY=argocd-application-controller --build-arg MAKE_TARGET=controller -t $(IMAGE_PREFIX)argocd-application-controller:$(IMAGE_TAG) -f Dockerfile-argocd .
|
||||
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-application-controller:$(IMAGE_TAG) ; fi
|
||||
|
||||
.PHONY: cli-image
|
||||
cli-image:
|
||||
docker build --build-arg BINARY=argocd --build-arg MAKE_TARGET=cli -t $(IMAGE_PREFIX)argocd-cli:$(IMAGE_TAG) -f Dockerfile-argocd .
|
||||
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd-cli:$(IMAGE_TAG) ; fi
|
||||
|
||||
.PHONY: builder-image
|
||||
builder-image:
|
||||
docker build -t $(IMAGE_PREFIX)argo-cd-ci-builder:$(IMAGE_TAG) -f Dockerfile-ci-builder .
|
||||
@@ -130,4 +135,4 @@ release-precheck:
|
||||
@if [ -z "$(GIT_TAG)" ]; then echo 'commit must be tagged to perform release' ; exit 1; fi
|
||||
|
||||
.PHONY: release
|
||||
release: release-precheck precheckin cli-darwin cli-linux server-image controller-image repo-server-image
|
||||
release: release-precheck precheckin cli-darwin cli-linux server-image controller-image repo-server-image cli-image
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/argoproj/argo-cd/controller"
|
||||
"github.com/argoproj/argo-cd/errors"
|
||||
appclientset "github.com/argoproj/argo-cd/pkg/client/clientset/versioned"
|
||||
"github.com/argoproj/argo-cd/reposerver"
|
||||
"github.com/argoproj/argo-cd/server/cluster"
|
||||
apirepository "github.com/argoproj/argo-cd/server/repository"
|
||||
"github.com/argoproj/argo-cd/util/cli"
|
||||
@@ -21,7 +22,6 @@ import (
|
||||
// load the gcp plugin (required to authenticate against GKE clusters).
|
||||
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
|
||||
// load the oidc plugin (required to authenticate with OpenID Connect).
|
||||
"github.com/argoproj/argo-cd/reposerver"
|
||||
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
|
||||
)
|
||||
|
||||
@@ -37,11 +37,17 @@ func newCommand() *cobra.Command {
|
||||
clientConfig clientcmd.ClientConfig
|
||||
appResyncPeriod int64
|
||||
repoServerAddress string
|
||||
workers int
|
||||
logLevel string
|
||||
)
|
||||
var command = cobra.Command{
|
||||
Use: cliName,
|
||||
Short: "application-controller is a controller to operate on applications CRD",
|
||||
RunE: func(c *cobra.Command, args []string) error {
|
||||
level, err := log.ParseLevel(logLevel)
|
||||
errors.CheckError(err)
|
||||
log.SetLevel(level)
|
||||
|
||||
config, err := clientConfig.ClientConfig()
|
||||
errors.CheckError(err)
|
||||
|
||||
@@ -77,7 +83,7 @@ func newCommand() *cobra.Command {
|
||||
defer cancel()
|
||||
|
||||
log.Infof("Application Controller (version: %s) starting (namespace: %s)", argocd.GetVersion(), namespace)
|
||||
go appController.Run(ctx, 1)
|
||||
go appController.Run(ctx, workers)
|
||||
// Wait forever
|
||||
select {}
|
||||
},
|
||||
@@ -86,6 +92,8 @@ func newCommand() *cobra.Command {
|
||||
clientConfig = cli.AddKubectlFlagsToCmd(&command)
|
||||
command.Flags().Int64Var(&appResyncPeriod, "app-resync", defaultAppResyncPeriod, "Time period in seconds for application resync.")
|
||||
command.Flags().StringVar(&repoServerAddress, "repo-server", "localhost:8081", "Repo server address.")
|
||||
command.Flags().IntVar(&workers, "workers", 1, "Number of application workers")
|
||||
command.Flags().StringVar(&logLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error")
|
||||
return &command
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/argoproj/argo-cd/errors"
|
||||
"github.com/argoproj/argo-cd/util/cli"
|
||||
"github.com/argoproj/argo-cd/util/git"
|
||||
"github.com/argoproj/argo-cd/util/ksonnet"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
@@ -55,7 +56,11 @@ func newCommand() *cobra.Command {
|
||||
listener, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
|
||||
errors.CheckError(err)
|
||||
|
||||
ksVers, err := ksonnet.KsonnetVersion()
|
||||
errors.CheckError(err)
|
||||
|
||||
log.Infof("argocd-repo-server %s serving on %s (namespace: %s)", argocd.GetVersion(), listener.Addr(), namespace)
|
||||
log.Infof("ksonnet version: %s", ksVers)
|
||||
err = grpc.Serve(listener)
|
||||
errors.CheckError(err)
|
||||
return nil
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
|
||||
@@ -27,7 +28,7 @@ import (
|
||||
func NewApplicationCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "app",
|
||||
Short: fmt.Sprintf("%s app COMMAND", cliName),
|
||||
Short: "Manage applications",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
@@ -38,6 +39,8 @@ func NewApplicationCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comman
|
||||
command.AddCommand(NewApplicationDiffCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationSetCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationSyncCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationHistoryCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationRollbackCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationListCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationDeleteCommand(clientOpts))
|
||||
return command
|
||||
@@ -53,7 +56,7 @@ func NewApplicationCreateCommand(clientOpts *argocdclient.ClientOptions) *cobra.
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "create",
|
||||
Short: fmt.Sprintf("%s app create", cliName),
|
||||
Short: "Create an application from a git location",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -106,7 +109,7 @@ func NewApplicationCreateCommand(clientOpts *argocdclient.ClientOptions) *cobra.
|
||||
defer util.Close(conn)
|
||||
created, err := appIf.Create(context.Background(), &app)
|
||||
errors.CheckError(err)
|
||||
fmt.Printf("application '%s' created", created.ObjectMeta.Name)
|
||||
fmt.Printf("application '%s' created\n", created.ObjectMeta.Name)
|
||||
},
|
||||
}
|
||||
command.Flags().StringVarP(&fileURL, "file", "f", "", "Filename or URL to Kubernetes manifests for the app")
|
||||
@@ -120,7 +123,7 @@ func NewApplicationCreateCommand(clientOpts *argocdclient.ClientOptions) *cobra.
|
||||
func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "get",
|
||||
Short: fmt.Sprintf("%s app get APPNAME", cliName),
|
||||
Short: "Get application details",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -173,7 +176,7 @@ func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "set",
|
||||
Short: fmt.Sprintf("%s app set APPNAME", cliName),
|
||||
Short: "Set application parameters",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 1 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -246,7 +249,7 @@ func addAppFlags(command *cobra.Command, opts *appOptions) {
|
||||
func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "diff",
|
||||
Short: fmt.Sprintf("%s app diff APPNAME", cliName),
|
||||
Short: "Perform a diff against the target and live state",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -288,7 +291,7 @@ func NewApplicationDeleteCommand(clientOpts *argocdclient.ClientOptions) *cobra.
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "delete",
|
||||
Short: fmt.Sprintf("%s app delete APPNAME", cliName),
|
||||
Short: "Delete an application",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -314,7 +317,7 @@ func NewApplicationDeleteCommand(clientOpts *argocdclient.ClientOptions) *cobra.
|
||||
func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: fmt.Sprintf("%s app list", cliName),
|
||||
Short: "List applications",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
|
||||
defer util.Close(conn)
|
||||
@@ -345,13 +348,15 @@ func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
|
||||
// NewApplicationSyncCommand returns a new instance of an `argocd app sync` command
|
||||
func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var (
|
||||
dryRun bool
|
||||
revision string
|
||||
prune bool
|
||||
dryRun bool
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "sync",
|
||||
Short: fmt.Sprintf("%s app sync APPNAME", cliName),
|
||||
Short: "Sync an application to its target state",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
if len(args) != 1 {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
}
|
||||
@@ -359,8 +364,10 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
|
||||
defer util.Close(conn)
|
||||
appName := args[0]
|
||||
syncReq := application.ApplicationSyncRequest{
|
||||
Name: appName,
|
||||
DryRun: dryRun,
|
||||
Name: appName,
|
||||
DryRun: dryRun,
|
||||
Revision: revision,
|
||||
Prune: prune,
|
||||
}
|
||||
syncRes, err := appIf.Sync(context.Background(), &syncReq)
|
||||
errors.CheckError(err)
|
||||
@@ -374,6 +381,8 @@ func NewApplicationSyncCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
|
||||
},
|
||||
}
|
||||
command.Flags().BoolVar(&dryRun, "dry-run", false, "Preview apply without affecting cluster")
|
||||
command.Flags().BoolVar(&prune, "prune", false, "Allow deleting unexpected resources")
|
||||
command.Flags().StringVar(&revision, "revision", "", "Sync to a specific revision. Preserves parameter overrides")
|
||||
return command
|
||||
}
|
||||
|
||||
@@ -413,3 +422,91 @@ func setParameterOverrides(app *argoappv1.Application, parameters []string) {
|
||||
}
|
||||
app.Spec.Source.ComponentParameterOverrides = newParams
|
||||
}
|
||||
|
||||
// NewApplicationHistoryCommand returns a new instance of an `argocd app history` command
|
||||
func NewApplicationHistoryCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "history",
|
||||
Short: "Show application deployment history",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 1 {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
}
|
||||
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
|
||||
defer util.Close(conn)
|
||||
appName := args[0]
|
||||
app, err := appIf.Get(context.Background(), &application.ApplicationQuery{Name: appName})
|
||||
errors.CheckError(err)
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
fmt.Fprintf(w, "ID\tDATE\tCOMMIT\tPARAMETERS\n")
|
||||
for _, depInfo := range app.Status.RecentDeployments {
|
||||
paramStr := paramString(depInfo.Params)
|
||||
fmt.Fprintf(w, "%d\t%s\t%s\t%s\n", depInfo.ID, depInfo.DeployedAt, depInfo.Revision, paramStr)
|
||||
}
|
||||
_ = w.Flush()
|
||||
},
|
||||
}
|
||||
return command
|
||||
}
|
||||
|
||||
func paramString(params []argoappv1.ComponentParameter) string {
|
||||
if len(params) == 0 {
|
||||
return ""
|
||||
}
|
||||
paramNames := []string{}
|
||||
for _, param := range params {
|
||||
paramNames = append(paramNames, fmt.Sprintf("%s=%s=%s", param.Component, param.Name, param.Value))
|
||||
}
|
||||
return strings.Join(paramNames, ",")
|
||||
}
|
||||
|
||||
// NewApplicationRollbackCommand returns a new instance of an `argocd app rollback` command
|
||||
func NewApplicationRollbackCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var (
|
||||
prune bool
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "rollback",
|
||||
Short: "Rollback application to a previous deployed version",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 2 {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
}
|
||||
appName := args[0]
|
||||
depID, err := strconv.Atoi(args[1])
|
||||
errors.CheckError(err)
|
||||
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
|
||||
defer util.Close(conn)
|
||||
ctx := context.Background()
|
||||
app, err := appIf.Get(ctx, &application.ApplicationQuery{Name: appName})
|
||||
errors.CheckError(err)
|
||||
var depInfo *argoappv1.DeploymentInfo
|
||||
for _, di := range app.Status.RecentDeployments {
|
||||
if di.ID == int64(depID) {
|
||||
depInfo = &di
|
||||
break
|
||||
}
|
||||
}
|
||||
if depInfo == nil {
|
||||
log.Fatalf("Application '%s' does not have deployment id '%d' in history\n", app.ObjectMeta.Name, depID)
|
||||
}
|
||||
syncRes, err := appIf.Rollback(ctx, &application.ApplicationRollbackRequest{
|
||||
Name: appName,
|
||||
ID: int64(depID),
|
||||
Prune: prune,
|
||||
})
|
||||
errors.CheckError(err)
|
||||
fmt.Printf("%s %s\n", appName, syncRes.Message)
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
fmt.Fprintf(w, "NAME\tKIND\tMESSAGE\n")
|
||||
for _, resDetails := range syncRes.Resources {
|
||||
fmt.Fprintf(w, "%s\t%s\t%s\n", resDetails.Name, resDetails.Kind, resDetails.Message)
|
||||
}
|
||||
_ = w.Flush()
|
||||
},
|
||||
}
|
||||
command.Flags().BoolVar(&prune, "prune", false, "Allow deleting unexpected resources")
|
||||
return command
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
func NewClusterCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clientcmd.PathOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "cluster",
|
||||
Short: fmt.Sprintf("%s cluster COMMAND", cliName),
|
||||
Short: "Manage cluster credentials",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
@@ -49,7 +49,7 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie
|
||||
var configAccess clientcmd.ConfigAccess = pathOpts
|
||||
if len(args) == 0 {
|
||||
log.Error("Choose a context name from:")
|
||||
printContexts(configAccess)
|
||||
printKubeContexts(configAccess)
|
||||
os.Exit(1)
|
||||
}
|
||||
config, err := configAccess.GetStartingConfig()
|
||||
@@ -65,14 +65,12 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie
|
||||
conf, err := clientConfig.ClientConfig()
|
||||
errors.CheckError(err)
|
||||
|
||||
if conf.Username == "" || conf.Password == "" {
|
||||
// Install RBAC resources for managing the cluster if username and password are not specified
|
||||
conf.BearerToken = common.InstallClusterManagerRBAC(conf)
|
||||
}
|
||||
// Install RBAC resources for managing the cluster
|
||||
managerBearerToken := common.InstallClusterManagerRBAC(conf)
|
||||
|
||||
conn, clusterIf := argocdclient.NewClientOrDie(clientOpts).NewClusterClientOrDie()
|
||||
defer util.Close(conn)
|
||||
clst := NewCluster(args[0], conf)
|
||||
clst := NewCluster(args[0], conf, managerBearerToken)
|
||||
clst, err = clusterIf.Create(context.Background(), clst)
|
||||
errors.CheckError(err)
|
||||
fmt.Printf("Cluster '%s' added\n", clst.Name)
|
||||
@@ -82,7 +80,7 @@ func NewClusterAddCommand(clientOpts *argocdclient.ClientOptions, pathOpts *clie
|
||||
return command
|
||||
}
|
||||
|
||||
func printContexts(ca clientcmd.ConfigAccess) {
|
||||
func printKubeContexts(ca clientcmd.ConfigAccess) {
|
||||
config, err := ca.GetStartingConfig()
|
||||
errors.CheckError(err)
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
@@ -110,7 +108,7 @@ func printContexts(ca clientcmd.ConfigAccess) {
|
||||
}
|
||||
}
|
||||
|
||||
func NewCluster(name string, conf *rest.Config) *argoappv1.Cluster {
|
||||
func NewCluster(name string, conf *rest.Config, managerBearerToken string) *argoappv1.Cluster {
|
||||
tlsClientConfig := argoappv1.TLSClientConfig{
|
||||
Insecure: conf.TLSClientConfig.Insecure,
|
||||
ServerName: conf.TLSClientConfig.ServerName,
|
||||
@@ -137,9 +135,7 @@ func NewCluster(name string, conf *rest.Config) *argoappv1.Cluster {
|
||||
Server: conf.Host,
|
||||
Name: name,
|
||||
Config: argoappv1.ClusterConfig{
|
||||
Username: conf.Username,
|
||||
Password: conf.Password,
|
||||
BearerToken: conf.BearerToken,
|
||||
BearerToken: managerBearerToken,
|
||||
TLSClientConfig: tlsClientConfig,
|
||||
},
|
||||
}
|
||||
@@ -150,7 +146,7 @@ func NewCluster(name string, conf *rest.Config) *argoappv1.Cluster {
|
||||
func NewClusterGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "get",
|
||||
Short: fmt.Sprintf("%s cluster get SERVER", cliName),
|
||||
Short: "Get cluster information",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -174,7 +170,7 @@ func NewClusterGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command
|
||||
func NewClusterRemoveCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "rm",
|
||||
Short: fmt.Sprintf("%s cluster rm SERVER", cliName),
|
||||
Short: "Remove cluster credentials",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -197,7 +193,7 @@ func NewClusterRemoveCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comm
|
||||
func NewClusterListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: fmt.Sprintf("%s cluster list", cliName),
|
||||
Short: "List configured clusters",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
conn, clusterIf := argocdclient.NewClientOrDie(clientOpts).NewClusterClientOrDie()
|
||||
defer util.Close(conn)
|
||||
|
||||
84
cmd/argocd/commands/context.go
Normal file
84
cmd/argocd/commands/context.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/argoproj/argo-cd/errors"
|
||||
argocdclient "github.com/argoproj/argo-cd/pkg/apiclient"
|
||||
"github.com/argoproj/argo-cd/util/localconfig"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// NewContextCommand returns a new instance of an `argocd ctx` command
|
||||
func NewContextCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "context",
|
||||
Aliases: []string{"ctx"},
|
||||
Short: "Switch between contexts",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
printArgoCDContexts(clientOpts.ConfigPath)
|
||||
return
|
||||
}
|
||||
ctxName := args[0]
|
||||
argoCDDir, err := localconfig.DefaultConfigDir()
|
||||
errors.CheckError(err)
|
||||
prevCtxFile := path.Join(argoCDDir, ".prev-ctx")
|
||||
|
||||
if ctxName == "-" {
|
||||
prevCtxBytes, err := ioutil.ReadFile(prevCtxFile)
|
||||
errors.CheckError(err)
|
||||
ctxName = string(prevCtxBytes)
|
||||
}
|
||||
localCfg, err := localconfig.ReadLocalConfig(clientOpts.ConfigPath)
|
||||
errors.CheckError(err)
|
||||
if localCfg.CurrentContext == ctxName {
|
||||
fmt.Printf("Already at context '%s'\n", localCfg.CurrentContext)
|
||||
return
|
||||
}
|
||||
if _, err = localCfg.ResolveContext(ctxName); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
prevCtx := localCfg.CurrentContext
|
||||
localCfg.CurrentContext = ctxName
|
||||
err = localconfig.WriteLocalConfig(*localCfg, clientOpts.ConfigPath)
|
||||
errors.CheckError(err)
|
||||
err = ioutil.WriteFile(prevCtxFile, []byte(prevCtx), 0644)
|
||||
errors.CheckError(err)
|
||||
fmt.Printf("Switched to context '%s'\n", localCfg.CurrentContext)
|
||||
},
|
||||
}
|
||||
return command
|
||||
}
|
||||
|
||||
func printArgoCDContexts(configPath string) {
|
||||
localCfg, err := localconfig.ReadLocalConfig(configPath)
|
||||
errors.CheckError(err)
|
||||
if localCfg == nil {
|
||||
log.Fatalf("No contexts defined in %s", configPath)
|
||||
}
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
defer func() { _ = w.Flush() }()
|
||||
columnNames := []string{"CURRENT", "NAME", "SERVER"}
|
||||
_, err = fmt.Fprintf(w, "%s\n", strings.Join(columnNames, "\t"))
|
||||
errors.CheckError(err)
|
||||
|
||||
for _, contextRef := range localCfg.Contexts {
|
||||
context, err := localCfg.ResolveContext(contextRef.Name)
|
||||
if err != nil {
|
||||
log.Warnf("Context '%s' had error: %v", contextRef.Name, err)
|
||||
}
|
||||
prefix := " "
|
||||
if localCfg.CurrentContext == context.Name {
|
||||
prefix = "*"
|
||||
}
|
||||
_, err = fmt.Fprintf(w, "%s\t%s\t%s\n", prefix, context.Name, context.Server.Server)
|
||||
errors.CheckError(err)
|
||||
}
|
||||
}
|
||||
@@ -6,21 +6,21 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/argoproj/argo-cd/errors"
|
||||
argocdclient "github.com/argoproj/argo-cd/pkg/apiclient"
|
||||
"github.com/argoproj/argo-cd/server/session"
|
||||
"github.com/argoproj/argo-cd/util"
|
||||
"github.com/argoproj/argo-cd/util/cli"
|
||||
grpc_util "github.com/argoproj/argo-cd/util/grpc"
|
||||
"github.com/argoproj/argo-cd/util/localconfig"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
// NewLoginCommand returns a new instance of `argocd login` command
|
||||
func NewLoginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var (
|
||||
name string
|
||||
username string
|
||||
password string
|
||||
)
|
||||
@@ -48,22 +48,7 @@ func NewLoginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comman
|
||||
}
|
||||
}
|
||||
|
||||
for username == "" {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("Username: ")
|
||||
usernameRaw, err := reader.ReadString('\n')
|
||||
errors.CheckError(err)
|
||||
username = strings.TrimSpace(usernameRaw)
|
||||
}
|
||||
for password == "" {
|
||||
fmt.Print("Password: ")
|
||||
passwordRaw, err := terminal.ReadPassword(syscall.Stdin)
|
||||
errors.CheckError(err)
|
||||
password = string(passwordRaw)
|
||||
if password == "" {
|
||||
fmt.Print("\n")
|
||||
}
|
||||
}
|
||||
username, password = cli.PromptCredentials(username, password)
|
||||
|
||||
clientOpts := argocdclient.ClientOptions{
|
||||
ConfigPath: "",
|
||||
@@ -88,7 +73,6 @@ func NewLoginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comman
|
||||
if localCfg == nil {
|
||||
localCfg = &localconfig.LocalConfig{}
|
||||
}
|
||||
localCfg.CurrentContext = server
|
||||
localCfg.UpsertServer(localconfig.Server{
|
||||
Server: server,
|
||||
PlainText: globalClientOpts.PlainText,
|
||||
@@ -98,8 +82,12 @@ func NewLoginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comman
|
||||
Name: server,
|
||||
AuthToken: createdSession.Token,
|
||||
})
|
||||
if name == "" {
|
||||
name = server
|
||||
}
|
||||
localCfg.CurrentContext = name
|
||||
localCfg.UpsertContext(localconfig.ContextRef{
|
||||
Name: server,
|
||||
Name: name,
|
||||
User: server,
|
||||
Server: server,
|
||||
})
|
||||
@@ -109,6 +97,7 @@ func NewLoginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comman
|
||||
|
||||
},
|
||||
}
|
||||
command.Flags().StringVar(&name, "name", "", "name to use for the context")
|
||||
command.Flags().StringVar(&username, "username", "", "the username of an account to authenticate")
|
||||
command.Flags().StringVar(&password, "password", "", "the password of an account to authenticate")
|
||||
return command
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"syscall"
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/argoproj/argo-cd/errors"
|
||||
@@ -14,17 +12,17 @@ import (
|
||||
appsv1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
|
||||
"github.com/argoproj/argo-cd/server/repository"
|
||||
"github.com/argoproj/argo-cd/util"
|
||||
"github.com/argoproj/argo-cd/util/cli"
|
||||
"github.com/argoproj/argo-cd/util/git"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
// NewRepoCommand returns a new instance of an `argocd repo` command
|
||||
func NewRepoCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "repo",
|
||||
Short: fmt.Sprintf("%s repo COMMAND", cliName),
|
||||
Short: "Manage git repository credentials",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
@@ -45,7 +43,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "add",
|
||||
Short: fmt.Sprintf("%s repo add REPO", cliName),
|
||||
Short: "Add git repository credentials",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 1 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -66,7 +64,7 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
log.Fatal(err)
|
||||
}
|
||||
// If we can't test the repo, it's probably private. Prompt for credentials and try again.
|
||||
promptCredentials(&repo)
|
||||
repo.Username, repo.Password = cli.PromptCredentials(repo.Username, repo.Password)
|
||||
err = git.TestRepo(repo.Repo, repo.Username, repo.Password, repo.SSHPrivateKey)
|
||||
}
|
||||
errors.CheckError(err)
|
||||
@@ -83,25 +81,11 @@ func NewRepoAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
return command
|
||||
}
|
||||
|
||||
func promptCredentials(repo *appsv1.Repository) {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
if repo.Username == "" {
|
||||
fmt.Print("Username: ")
|
||||
username, _ := reader.ReadString('\n')
|
||||
repo.Username = username
|
||||
}
|
||||
if repo.Password == "" {
|
||||
fmt.Print("Password: ")
|
||||
bytePassword, _ := terminal.ReadPassword(syscall.Stdin)
|
||||
repo.Password = string(bytePassword)
|
||||
}
|
||||
}
|
||||
|
||||
// NewRepoRemoveCommand returns a new instance of an `argocd repo list` command
|
||||
func NewRepoRemoveCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "rm",
|
||||
Short: fmt.Sprintf("%s repo rm REPO", cliName),
|
||||
Short: "Remove git repository credentials",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
c.HelpFunc()(c, args)
|
||||
@@ -122,7 +106,7 @@ func NewRepoRemoveCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command
|
||||
func NewRepoListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var command = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: fmt.Sprintf("%s repo list", cliName),
|
||||
Short: "List configured repositories",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
conn, repoIf := argocdclient.NewClientOrDie(clientOpts).NewRepoClientOrDie()
|
||||
defer util.Close(conn)
|
||||
|
||||
@@ -30,6 +30,7 @@ func NewCommand() *cobra.Command {
|
||||
command.AddCommand(NewRepoCommand(&clientOpts))
|
||||
command.AddCommand(NewInstallCommand())
|
||||
command.AddCommand(NewUninstallCommand())
|
||||
command.AddCommand(NewContextCommand(&clientOpts))
|
||||
|
||||
defaultLocalConfigPath, err := localconfig.DefaultLocalConfigPath()
|
||||
errors.CheckError(err)
|
||||
|
||||
@@ -43,7 +43,7 @@ func NewVersionCmd(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
defer util.Close(conn)
|
||||
serverVers, err := versionIf.Version(context.Background(), &empty.Empty{})
|
||||
errors.CheckError(err)
|
||||
fmt.Printf("%s: %s\n", "argocd-server", version)
|
||||
fmt.Printf("%s: %s\n", "argocd-server", serverVers.Version)
|
||||
if !short {
|
||||
fmt.Printf(" BuildDate: %s\n", serverVers.BuildDate)
|
||||
fmt.Printf(" GitCommit: %s\n", serverVers.GitCommit)
|
||||
|
||||
@@ -14,6 +14,8 @@ import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/client-go/discovery"
|
||||
"k8s.io/client-go/dynamic"
|
||||
)
|
||||
|
||||
// AppComparator defines methods which allow to compare application spec and actual application state.
|
||||
@@ -79,19 +81,57 @@ func (ks *KsonnetAppComparator) CompareAppState(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
restConfig := clst.RESTConfig()
|
||||
|
||||
// Retrieve the live versions of the objects
|
||||
liveObjs, err := kubeutil.GetResourcesWithLabel(clst.RESTConfig(), namespace, common.LabelApplicationName, app.Name)
|
||||
|
||||
liveObjs, err := kubeutil.GetResourcesWithLabel(restConfig, namespace, common.LabelApplicationName, app.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objByFullName := ks.groupLiveObjects(liveObjs, targetObjs)
|
||||
|
||||
liveObjByFullName := ks.groupLiveObjects(liveObjs, targetObjs)
|
||||
|
||||
controlledLiveObj := make([]*unstructured.Unstructured, len(targetObjs))
|
||||
|
||||
// Move live resources which have corresponding target object to controlledLiveObj
|
||||
dynClientPool := dynamic.NewDynamicClientPool(restConfig)
|
||||
disco, err := discovery.NewDiscoveryClientForConfig(restConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for i, targetObj := range targetObjs {
|
||||
controlledLiveObj[i] = objByFullName[getResourceFullName(targetObj)]
|
||||
fullName := getResourceFullName(targetObj)
|
||||
liveObj := liveObjByFullName[fullName]
|
||||
if liveObj == nil {
|
||||
// If we get here, it indicates we did not find the live resource when querying using
|
||||
// our app label. However, it is possible that the resource was created/modified outside
|
||||
// of ArgoCD. In order to determine that it is truly missing, we fall back to perform a
|
||||
// direct lookup of the resource by name. See issue #141
|
||||
gvk := targetObj.GroupVersionKind()
|
||||
dclient, err := dynClientPool.ClientForGroupVersionKind(gvk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
apiResource, err := kubeutil.ServerResourceForGroupVersionKind(disco, gvk)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
liveObj, err = kubeutil.GetLiveResource(dclient, targetObj, apiResource, namespace)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
controlledLiveObj[i] = liveObj
|
||||
delete(liveObjByFullName, fullName)
|
||||
}
|
||||
|
||||
// Move root level live resources to controlledLiveObj and add nil to targetObjs to indicate that target object is missing
|
||||
for fullName := range liveObjByFullName {
|
||||
liveObj := liveObjByFullName[fullName]
|
||||
if !hasParent(liveObj) {
|
||||
targetObjs = append(targetObjs, nil)
|
||||
controlledLiveObj = append(controlledLiveObj, liveObj)
|
||||
}
|
||||
}
|
||||
|
||||
// Do the actual comparison
|
||||
@@ -99,19 +139,40 @@ func (ks *KsonnetAppComparator) CompareAppState(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
comparisonStatus := v1alpha1.ComparisonStatusSynced
|
||||
|
||||
resources := make([]v1alpha1.ResourceState, len(targetObjs))
|
||||
for i := 0; i < len(targetObjs); i++ {
|
||||
resState := v1alpha1.ResourceState{
|
||||
ChildLiveResources: make([]v1alpha1.ResourceNode, 0),
|
||||
}
|
||||
targetObjBytes, err := json.Marshal(targetObjs[i].Object)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
diffResult := diffResults.Diffs[i]
|
||||
if diffResult.Modified {
|
||||
// Set resource state to 'OutOfSync' since target and corresponding live resource are different
|
||||
resState.Status = v1alpha1.ComparisonStatusOutOfSync
|
||||
comparisonStatus = v1alpha1.ComparisonStatusOutOfSync
|
||||
} else {
|
||||
resState.Status = v1alpha1.ComparisonStatusSynced
|
||||
}
|
||||
resState.TargetState = string(targetObjBytes)
|
||||
|
||||
if targetObjs[i] == nil {
|
||||
resState.TargetState = "null"
|
||||
// Set resource state to 'OutOfSync' since target resource is missing and live resource is unexpected
|
||||
resState.Status = v1alpha1.ComparisonStatusOutOfSync
|
||||
comparisonStatus = v1alpha1.ComparisonStatusOutOfSync
|
||||
} else {
|
||||
targetObjBytes, err := json.Marshal(targetObjs[i].Object)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resState.TargetState = string(targetObjBytes)
|
||||
}
|
||||
|
||||
if controlledLiveObj[i] == nil {
|
||||
resState.LiveState = "null"
|
||||
// Set resource state to 'OutOfSync' since target resource present but corresponding live resource is missing
|
||||
resState.Status = v1alpha1.ComparisonStatusOutOfSync
|
||||
comparisonStatus = v1alpha1.ComparisonStatusOutOfSync
|
||||
} else {
|
||||
liveObjBytes, err := json.Marshal(controlledLiveObj[i].Object)
|
||||
if err != nil {
|
||||
@@ -119,19 +180,14 @@ func (ks *KsonnetAppComparator) CompareAppState(
|
||||
}
|
||||
resState.LiveState = string(liveObjBytes)
|
||||
}
|
||||
diffResult := diffResults.Diffs[i]
|
||||
if diffResult.Modified {
|
||||
resState.Status = v1alpha1.ComparisonStatusOutOfSync
|
||||
} else {
|
||||
resState.Status = v1alpha1.ComparisonStatusSynced
|
||||
}
|
||||
|
||||
resources[i] = resState
|
||||
}
|
||||
|
||||
for i, resource := range resources {
|
||||
liveResource := controlledLiveObj[i]
|
||||
if liveResource != nil {
|
||||
childResources, err := getChildren(liveResource, objByFullName)
|
||||
childResources, err := getChildren(liveResource, liveObjByFullName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -145,26 +201,36 @@ func (ks *KsonnetAppComparator) CompareAppState(
|
||||
Server: clst.Server,
|
||||
Namespace: namespace,
|
||||
Resources: resources,
|
||||
}
|
||||
if diffResults.Modified {
|
||||
compResult.Status = v1alpha1.ComparisonStatusOutOfSync
|
||||
} else {
|
||||
compResult.Status = v1alpha1.ComparisonStatusSynced
|
||||
Status: comparisonStatus,
|
||||
}
|
||||
return &compResult, nil
|
||||
}
|
||||
|
||||
func getChildren(parent *unstructured.Unstructured, objByFullName map[string]*unstructured.Unstructured) ([]v1alpha1.ResourceNode, error) {
|
||||
func hasParent(obj *unstructured.Unstructured) bool {
|
||||
// TODO: remove special case after Service and Endpoint get explicit relationship ( https://github.com/kubernetes/kubernetes/issues/28483 )
|
||||
return obj.GetKind() == kubeutil.EndpointsKind || metav1.GetControllerOf(obj) != nil
|
||||
}
|
||||
|
||||
func isControlledBy(obj *unstructured.Unstructured, parent *unstructured.Unstructured) bool {
|
||||
// TODO: remove special case after Service and Endpoint get explicit relationship ( https://github.com/kubernetes/kubernetes/issues/28483 )
|
||||
if obj.GetKind() == kubeutil.EndpointsKind && parent.GetKind() == kubeutil.ServiceKind {
|
||||
return obj.GetName() == parent.GetName()
|
||||
}
|
||||
return metav1.IsControlledBy(obj, parent)
|
||||
}
|
||||
|
||||
func getChildren(parent *unstructured.Unstructured, liveObjByFullName map[string]*unstructured.Unstructured) ([]v1alpha1.ResourceNode, error) {
|
||||
children := make([]v1alpha1.ResourceNode, 0)
|
||||
for _, obj := range objByFullName {
|
||||
if metav1.IsControlledBy(obj, parent) {
|
||||
for fullName, obj := range liveObjByFullName {
|
||||
if isControlledBy(obj, parent) {
|
||||
delete(liveObjByFullName, fullName)
|
||||
childResource := v1alpha1.ResourceNode{}
|
||||
json, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
childResource.State = string(json)
|
||||
childResourceChildren, err := getChildren(obj, objByFullName)
|
||||
childResourceChildren, err := getChildren(obj, liveObjByFullName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -9,11 +9,16 @@ An example Ksonnet guestbook application is provided to demonstrates how Argo CD
|
||||
|
||||
## 1. Download Argo CD
|
||||
|
||||
Download the latest Argo CD version from the [releases](https://github.com/argoproj/argo-cd/releases) page.
|
||||
|
||||
## 2. Install the Argo CD components
|
||||
Download the latest Argo CD version
|
||||
```
|
||||
$ argocd install
|
||||
curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/v0.3.1/argocd-darwin-amd64
|
||||
chmod +x /usr/local/bin/argocd
|
||||
```
|
||||
|
||||
|
||||
## 2. Install Argo CD
|
||||
```
|
||||
argocd install
|
||||
```
|
||||
This will create a new namespace, `argocd`, where Argo CD services and application resources will live.
|
||||
|
||||
@@ -23,13 +28,13 @@ By default, the Argo CD API server is not exposed with an external IP. To expose
|
||||
change service type to `LoadBalancer`:
|
||||
|
||||
```
|
||||
$ kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
|
||||
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
|
||||
```
|
||||
|
||||
# 4. Login to the server from the CLI
|
||||
|
||||
```
|
||||
$ argocd login $(minikube service argocd-server -n argocd --url | cut -d'/' -f 3)
|
||||
argocd login $(minikube service argocd-server -n argocd --url | cut -d'/' -f 3)
|
||||
```
|
||||
|
||||
Now, the Argo CD cli is configured to talk to API server and you can deploy your first application.
|
||||
@@ -39,7 +44,7 @@ Now, the Argo CD cli is configured to talk to API server and you can deploy your
|
||||
1. Register the minikube cluster to Argo CD:
|
||||
|
||||
```
|
||||
$ argocd cluster add minikube
|
||||
argocd cluster add minikube
|
||||
```
|
||||
The `argocd cluster add CONTEXT` command installs an `argocd-manager` ServiceAccount and ClusterRole into
|
||||
the cluster associated with the supplied kubectl context. Argo CD then uses the associated service account
|
||||
@@ -48,21 +53,21 @@ token to perform its required management tasks (i.e. deploy/monitoring).
|
||||
2. Add the guestbook application and github repository containing the Guestbook application
|
||||
|
||||
```
|
||||
$ argocd app create --name guestbook --repo https://github.com/argoproj/argo-cd.git --path examples/guestbook --env minikube --dest-server https://$(minikube ip):8443
|
||||
argocd app create --name guestbook --repo https://github.com/argoproj/argo-cd.git --path examples/guestbook --env minikube --dest-server https://$(minikube ip):8443
|
||||
```
|
||||
|
||||
Once the application is added, you can now see its status:
|
||||
|
||||
```
|
||||
$ argocd app list
|
||||
$ argocd app sync guestbook
|
||||
argocd app list
|
||||
argocd app get guestbook
|
||||
```
|
||||
|
||||
The application status is initially in an `OutOfSync` state, since the application has yet to be
|
||||
deployed, and no Kubernetes resouces have been created. To sync (deploy) the application, run:
|
||||
deployed, and no Kubernetes resources have been created. To sync (deploy) the application, run:
|
||||
|
||||
```
|
||||
$ argocd app sync guestbook
|
||||
argocd app sync guestbook
|
||||
```
|
||||
|
||||
[](https://asciinema.org/a/uYnbFMy5WI2rc9S49oEAyGLb0)
|
||||
@@ -70,7 +75,7 @@ $ argocd app sync guestbook
|
||||
Argo CD also allows to view and manager applications using web UI. Get the web UI URL by running:
|
||||
|
||||
```
|
||||
$ minikube service argocd-server -n argocd --url
|
||||
minikube service argocd-server -n argocd --url
|
||||
```
|
||||
|
||||

|
||||
|
||||
@@ -39,10 +39,19 @@ go-to-protobuf \
|
||||
--apimachinery-packages=$(IFS=, ; echo "${APIMACHINERY_PKGS[*]}") \
|
||||
--proto-import=./vendor
|
||||
|
||||
# protoc-gen-go or protoc-gen-gofast is used to build server/*/<service>.pb.go from .proto files
|
||||
# NOTE: it is possible to use golang/protobuf or gogo/protobuf interchangeably
|
||||
go build -i -o dist/protoc-gen-gofast ./vendor/github.com/gogo/protobuf/protoc-gen-gofast
|
||||
# Either protoc-gen-go, protoc-gen-gofast, or protoc-gen-gogofast can be used to build
|
||||
# server/*/<service>.pb.go from .proto files. golang/protobuf and gogo/protobuf can be used
|
||||
# interchangeably. The difference in the options are:
|
||||
# 1. protoc-gen-go - official golang/protobuf
|
||||
#go build -i -o dist/protoc-gen-go ./vendor/github.com/golang/protobuf/protoc-gen-go
|
||||
#GOPROTOBINARY=go
|
||||
# 2. protoc-gen-gofast - fork of golang golang/protobuf. Faster code generation
|
||||
#go build -i -o dist/protoc-gen-gofast ./vendor/github.com/gogo/protobuf/protoc-gen-gofast
|
||||
#GOPROTOBINARY=gofast
|
||||
# 3. protoc-gen-gogofast - faster code generation and gogo extensions and flexibility in controlling
|
||||
# the generated go code (e.g. customizing field names, nullable fields)
|
||||
go build -i -o dist/protoc-gen-gogofast ./vendor/github.com/gogo/protobuf/protoc-gen-gogofast
|
||||
GOPROTOBINARY=gogofast
|
||||
|
||||
# protoc-gen-grpc-gateway is used to build <service>.pb.gw.go files from from .proto files
|
||||
go build -i -o dist/protoc-gen-grpc-gateway ./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
|
||||
@@ -50,7 +59,6 @@ go build -i -o dist/protoc-gen-grpc-gateway ./vendor/github.com/grpc-ecosystem/g
|
||||
# Generate server/<service>/(<service>.pb.go|<service>.pb.gw.go)
|
||||
PROTO_FILES=$(find $PROJECT_ROOT \( -name "*.proto" -and -path '*/server/*' -or -path '*/reposerver/*' -and -name "*.proto" \))
|
||||
for i in ${PROTO_FILES}; do
|
||||
|
||||
# Path to the google API gateway annotations.proto will be different depending if we are
|
||||
# building natively (e.g. from workspace) vs. part of a docker build.
|
||||
if [ -f /.dockerenv ]; then
|
||||
@@ -67,7 +75,7 @@ for i in ${PROTO_FILES}; do
|
||||
-I$GOPATH/src \
|
||||
-I${GOOGLE_PROTO_API_PATH} \
|
||||
-I${GOGO_PROTOBUF_PATH} \
|
||||
--go_out=plugins=grpc:$GOPATH/src \
|
||||
--${GOPROTOBINARY}_out=plugins=grpc:$GOPATH/src \
|
||||
--grpc-gateway_out=logtostderr=true:$GOPATH/src \
|
||||
$i
|
||||
done
|
||||
|
||||
@@ -203,7 +203,6 @@ func (i *Installer) InstallApplicationController() {
|
||||
i.unmarshalManifest("03b_application-controller-role.yaml", &applicationControllerRole)
|
||||
i.unmarshalManifest("03c_application-controller-rolebinding.yaml", &applicationControllerRoleBinding)
|
||||
i.unmarshalManifest("03d_application-controller-deployment.yaml", &applicationControllerDeployment)
|
||||
applicationControllerRoleBinding.Subjects[0].Namespace = i.Namespace
|
||||
applicationControllerDeployment.Spec.Template.Spec.Containers[0].Image = i.ControllerImage
|
||||
applicationControllerDeployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = apiv1.PullPolicy(i.ImagePullPolicy)
|
||||
i.MustInstallResource(kube.MustToUnstructured(&applicationControllerServiceAccount))
|
||||
@@ -223,7 +222,6 @@ func (i *Installer) InstallArgoCDServer() {
|
||||
i.unmarshalManifest("04c_argocd-server-rolebinding.yaml", &argoCDServerControllerRoleBinding)
|
||||
i.unmarshalManifest("04d_argocd-server-deployment.yaml", &argoCDServerControllerDeployment)
|
||||
i.unmarshalManifest("04e_argocd-server-service.yaml", &argoCDServerService)
|
||||
argoCDServerControllerRoleBinding.Subjects[0].Namespace = i.Namespace
|
||||
argoCDServerControllerDeployment.Spec.Template.Spec.InitContainers[0].Image = i.UIImage
|
||||
argoCDServerControllerDeployment.Spec.Template.Spec.InitContainers[0].ImagePullPolicy = apiv1.PullPolicy(i.ImagePullPolicy)
|
||||
argoCDServerControllerDeployment.Spec.Template.Spec.Containers[0].Image = i.ServerImage
|
||||
|
||||
@@ -10,4 +10,3 @@ roleRef:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: application-controller
|
||||
namespace: argocd
|
||||
|
||||
@@ -10,4 +10,3 @@ roleRef:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: argocd-server
|
||||
namespace: argocd
|
||||
|
||||
@@ -96,6 +96,10 @@ func NewClient(opts *ClientOptions) (ServerClient, error) {
|
||||
if opts.ServerAddr != "" {
|
||||
c.ServerAddr = opts.ServerAddr
|
||||
}
|
||||
// Make sure we got the server address and auth token from somewhere
|
||||
if c.ServerAddr == "" {
|
||||
return nil, errors.New("ArgoCD server address unspecified")
|
||||
}
|
||||
if parts := strings.Split(c.ServerAddr, ":"); len(parts) == 1 {
|
||||
// If port is unspecified, assume the most likely port
|
||||
c.ServerAddr += ":443"
|
||||
@@ -122,11 +126,6 @@ func NewClient(opts *ClientOptions) (ServerClient, error) {
|
||||
if opts.Insecure {
|
||||
c.Insecure = true
|
||||
}
|
||||
|
||||
// Make sure we got the server address and auth token from somewhere
|
||||
if c.ServerAddr == "" {
|
||||
return nil, errors.New("Argo CD server address unspecified")
|
||||
}
|
||||
return &c, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -668,6 +668,9 @@ func (m *DeploymentInfo) MarshalTo(dAtA []byte) (int, error) {
|
||||
return 0, err
|
||||
}
|
||||
i += n14
|
||||
dAtA[i] = 0x28
|
||||
i++
|
||||
i = encodeVarintGenerated(dAtA, i, uint64(m.ID))
|
||||
return i, nil
|
||||
}
|
||||
|
||||
@@ -1071,6 +1074,7 @@ func (m *DeploymentInfo) Size() (n int) {
|
||||
}
|
||||
l = m.DeployedAt.Size()
|
||||
n += 1 + l + sovGenerated(uint64(l))
|
||||
n += 1 + sovGenerated(uint64(m.ID))
|
||||
return n
|
||||
}
|
||||
|
||||
@@ -1324,6 +1328,7 @@ func (this *DeploymentInfo) String() string {
|
||||
`Revision:` + fmt.Sprintf("%v", this.Revision) + `,`,
|
||||
`ComponentParameterOverrides:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ComponentParameterOverrides), "ComponentParameter", "ComponentParameter", 1), `&`, ``, 1) + `,`,
|
||||
`DeployedAt:` + strings.Replace(strings.Replace(this.DeployedAt.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`,
|
||||
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
return s
|
||||
@@ -3307,6 +3312,25 @@ func (m *DeploymentInfo) Unmarshal(dAtA []byte) error {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
|
||||
}
|
||||
m.ID = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenerated
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.ID |= (int64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenerated(dAtA[iNdEx:])
|
||||
@@ -4185,103 +4209,104 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptorGenerated = []byte{
|
||||
// 1561 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xdd, 0x6f, 0x1b, 0xc5,
|
||||
0x16, 0xcf, 0xc6, 0xce, 0xd7, 0x71, 0xbe, 0x3a, 0x57, 0xed, 0xf5, 0x4d, 0x25, 0x27, 0xda, 0xea,
|
||||
0xde, 0x5b, 0x10, 0x5d, 0xd3, 0xf2, 0x0d, 0x12, 0x52, 0xd7, 0x09, 0x34, 0x24, 0x6d, 0xc3, 0xc4,
|
||||
0x05, 0x09, 0x21, 0x60, 0xb3, 0x9e, 0xda, 0xdb, 0xd8, 0xbb, 0xcb, 0xcc, 0xd8, 0x95, 0x1f, 0x90,
|
||||
0x8a, 0xc4, 0x23, 0xa0, 0x22, 0xfe, 0x0b, 0x1e, 0x11, 0xcf, 0x3c, 0x20, 0x21, 0x8a, 0xc4, 0x43,
|
||||
0x25, 0x78, 0xa8, 0x10, 0x8a, 0x68, 0xfa, 0xc2, 0xdf, 0xd0, 0x27, 0x34, 0xb3, 0xb3, 0xb3, 0x63,
|
||||
0x9b, 0x90, 0xb4, 0x76, 0x2b, 0xde, 0xbc, 0xe7, 0xfc, 0xe6, 0xfc, 0xce, 0x9e, 0x39, 0x5f, 0x6b,
|
||||
0x58, 0xaf, 0x07, 0xbc, 0xd1, 0xde, 0x71, 0xfc, 0xa8, 0x55, 0xf6, 0x68, 0x3d, 0x8a, 0x69, 0x74,
|
||||
0x4d, 0xfe, 0x38, 0xe3, 0xd7, 0xca, 0xf1, 0x6e, 0xbd, 0xec, 0xc5, 0x01, 0x2b, 0x7b, 0x71, 0xdc,
|
||||
0x0c, 0x7c, 0x8f, 0x07, 0x51, 0x58, 0xee, 0x9c, 0xf5, 0x9a, 0x71, 0xc3, 0x3b, 0x5b, 0xae, 0x93,
|
||||
0x90, 0x50, 0x8f, 0x93, 0x9a, 0x13, 0xd3, 0x88, 0x47, 0xe8, 0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, 0xdf, 0xdb, 0x31, 0xf1, 0xdd, 0x59, 0xc5,
|
||||
0x9b, 0x17, 0x4f, 0x58, 0xb2, 0x20, 0x0e, 0x93, 0x8c, 0x7b, 0xbc, 0xcd, 0x8a, 0x39, 0xc9, 0xb7,
|
||||
0x39, 0x22, 0x3e, 0x69, 0xd3, 0x9d, 0x57, 0x8c, 0x93, 0xc9, 0x33, 0x56, 0x5c, 0xf6, 0x87, 0x70,
|
||||
0xc2, 0x00, 0xaf, 0x12, 0xc6, 0x83, 0x30, 0x89, 0xef, 0xff, 0x60, 0x92, 0x11, 0xda, 0x21, 0x54,
|
||||
0x46, 0x77, 0xc6, 0xb0, 0x20, 0xa5, 0x58, 0x69, 0x51, 0x19, 0x66, 0x42, 0xaf, 0x45, 0x58, 0xec,
|
||||
0xf9, 0x44, 0x86, 0x6a, 0xc6, 0x3d, 0xa6, 0xa0, 0x33, 0x97, 0x52, 0x05, 0xce, 0x30, 0xf6, 0x6f,
|
||||
0x16, 0x2c, 0x18, 0x9c, 0x9b, 0x01, 0xe3, 0xe8, 0xdd, 0x81, 0xcb, 0x74, 0x8e, 0x76, 0x99, 0xe2,
|
||||
0xb4, 0xbc, 0xca, 0x45, 0xc5, 0x39, 0x9d, 0x4a, 0x8c, 0x8b, 0xdc, 0x85, 0x89, 0x80, 0x93, 0x16,
|
||||
0x2b, 0x8e, 0xaf, 0xe4, 0x4e, 0x17, 0xce, 0xbd, 0x36, 0x9a, 0xc8, 0xba, 0x73, 0x8a, 0x72, 0x62,
|
||||
0x5d, 0x18, 0xc7, 0x09, 0x87, 0xfd, 0x79, 0x0e, 0x8e, 0x99, 0xf1, 0x8f, 0xda, 0xd4, 0x27, 0xe8,
|
||||
0x09, 0x98, 0xa2, 0x24, 0x8e, 0xae, 0xe0, 0x4d, 0x15, 0xce, 0x05, 0x75, 0x78, 0x0a, 0x27, 0x62,
|
||||
0x9c, 0xea, 0xd1, 0x0a, 0xe4, 0x63, 0x8f, 0x37, 0x54, 0x2c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0x0b,
|
||||
0x90, 0x7c, 0x05, 0x61, 0x59, 0xb7, 0xeb, 0x62, 0x7e, 0xb4, 0x71, 0x5b, 0x52, 0x1e, 0xa1, 0xca,
|
||||
0x00, 0x15, 0xfe, 0x0b, 0x7a, 0xfb, 0x0f, 0x0b, 0xfa, 0xd7, 0x24, 0x51, 0x54, 0x41, 0xc8, 0x88,
|
||||
0xdf, 0xa6, 0x49, 0x28, 0xa7, 0xb3, 0xdb, 0x58, 0x57, 0x72, 0xac, 0x11, 0xf2, 0xdb, 0x50, 0x8e,
|
||||
0xd5, 0x4b, 0x59, 0xc9, 0x66, 0xdf, 0x86, 0x5a, 0x83, 0x0d, 0x14, 0x3a, 0x0d, 0xd3, 0x3e, 0xa1,
|
||||
0x7c, 0x55, 0x14, 0x8e, 0x88, 0xe4, 0xac, 0x3b, 0x2b, 0xef, 0x5a, 0xc9, 0xb0, 0xd6, 0xa2, 0xff,
|
||||
0xc2, 0xd4, 0x2e, 0xe9, 0x4a, 0x60, 0x5e, 0x02, 0x0b, 0xfb, 0x7b, 0xcb, 0x53, 0x1b, 0x89, 0x08,
|
||||
0xa7, 0x3a, 0x64, 0xc3, 0xa4, 0xef, 0x49, 0xd4, 0x84, 0x44, 0x81, 0xdc, 0x90, 0xcf, 0x4b, 0x90,
|
||||
0xd2, 0xb8, 0xce, 0xad, 0xbb, 0xa5, 0xb1, 0xdb, 0x77, 0x4b, 0x63, 0x77, 0xee, 0x96, 0xc6, 0x6e,
|
||||
0xec, 0x97, 0xac, 0x5b, 0xfb, 0x25, 0xeb, 0xf6, 0x7e, 0xc9, 0xba, 0xb3, 0x5f, 0xb2, 0x7e, 0xdf,
|
||||
0x2f, 0x59, 0x37, 0xef, 0x95, 0xc6, 0xde, 0x99, 0x4e, 0xe3, 0xfa, 0x67, 0x00, 0x00, 0x00, 0xff,
|
||||
0xff, 0xcc, 0x40, 0x0d, 0xa8, 0xc8, 0x15, 0x00, 0x00,
|
||||
// 1579 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x8f, 0x1b, 0x45,
|
||||
0x16, 0x9f, 0xb6, 0x3d, 0x5f, 0xcf, 0xf3, 0x95, 0x5a, 0x25, 0xeb, 0x9d, 0x48, 0x9e, 0x51, 0x47,
|
||||
0xbb, 0x9b, 0x5d, 0x6d, 0xda, 0x9b, 0xec, 0x07, 0x5f, 0x12, 0x52, 0xda, 0x33, 0x90, 0x61, 0x26,
|
||||
0xc9, 0x50, 0xe3, 0x80, 0x84, 0x10, 0xd0, 0xd3, 0xae, 0xd8, 0x9d, 0xb1, 0xbb, 0x9b, 0xaa, 0xb2,
|
||||
0x23, 0x1f, 0x90, 0x82, 0xc4, 0x11, 0x50, 0x10, 0xff, 0x05, 0x47, 0xc4, 0x99, 0x03, 0x12, 0x22,
|
||||
0xdc, 0x22, 0xc1, 0x21, 0x42, 0x68, 0x44, 0x26, 0x97, 0xfc, 0x0d, 0x39, 0xa1, 0xaa, 0xae, 0xae,
|
||||
0x2e, 0xdb, 0x0c, 0x33, 0x89, 0x9d, 0x88, 0x9b, 0xfb, 0xbd, 0x5f, 0xbd, 0xdf, 0xeb, 0x57, 0xef,
|
||||
0xab, 0x0d, 0x1b, 0x8d, 0x80, 0x37, 0x3b, 0xbb, 0x8e, 0x1f, 0xb5, 0x2b, 0x1e, 0x6d, 0x44, 0x31,
|
||||
0x8d, 0x6e, 0xc8, 0x1f, 0xe7, 0xfc, 0x7a, 0x25, 0xde, 0x6b, 0x54, 0xbc, 0x38, 0x60, 0x15, 0x2f,
|
||||
0x8e, 0x5b, 0x81, 0xef, 0xf1, 0x20, 0x0a, 0x2b, 0xdd, 0xf3, 0x5e, 0x2b, 0x6e, 0x7a, 0xe7, 0x2b,
|
||||
0x0d, 0x12, 0x12, 0xea, 0x71, 0x52, 0x77, 0x62, 0x1a, 0xf1, 0x08, 0xbd, 0x90, 0x99, 0x72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 0x6b, 0x00, 0x00,
|
||||
0x00, 0xff, 0xff, 0xdc, 0x24, 0x80, 0x9e, 0xe4, 0x15, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -166,6 +166,8 @@ message DeploymentInfo {
|
||||
repeated ComponentParameter componentParameterOverrides = 3;
|
||||
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.Time deployedAt = 4;
|
||||
|
||||
optional int64 id = 5;
|
||||
}
|
||||
|
||||
// Repository is a Git repository holding application configurations
|
||||
|
||||
@@ -17,6 +17,7 @@ type DeploymentInfo struct {
|
||||
Revision string `json:"revision" protobuf:"bytes,2,opt,name=revision"`
|
||||
ComponentParameterOverrides []ComponentParameter `json:"componentParameterOverrides,omitempty" protobuf:"bytes,3,opt,name=componentParameterOverrides"`
|
||||
DeployedAt metav1.Time `json:"deployedAt" protobuf:"bytes,4,opt,name=deployedAt"`
|
||||
ID int64 `json:"id" protobuf:"bytes,5,opt,name=id"`
|
||||
}
|
||||
|
||||
// Application is a definition of Application resource.
|
||||
@@ -191,9 +192,9 @@ type TLSClientConfig struct {
|
||||
// Repository is a Git repository holding application configurations
|
||||
type Repository struct {
|
||||
Repo string `json:"repo" protobuf:"bytes,1,opt,name=repo"`
|
||||
Username string `json:"username" protobuf:"bytes,2,opt,name=username"`
|
||||
Password string `json:"password" protobuf:"bytes,3,opt,name=password"`
|
||||
SSHPrivateKey string `json:"sshPrivateKey" protobuf:"bytes,4,opt,name=sshPrivateKey"`
|
||||
Username string `json:"username,omitempty" protobuf:"bytes,2,opt,name=username"`
|
||||
Password string `json:"password,omitempty" protobuf:"bytes,3,opt,name=password"`
|
||||
SSHPrivateKey string `json:"sshPrivateKey,omitempty" protobuf:"bytes,4,opt,name=sshPrivateKey"`
|
||||
}
|
||||
|
||||
// RepositoryList is a collection of Repositories.
|
||||
|
||||
@@ -37,15 +37,9 @@ func NewService(namespace string, kubeClient kubernetes.Interface, gitClient git
|
||||
}
|
||||
|
||||
func (s *Service) GetKsonnetApp(ctx context.Context, in *KsonnetAppRequest) (*KsonnetAppResponse, error) {
|
||||
appRepoPath := path.Join(os.TempDir(), strings.Replace(in.Repo.Repo, "/", "_", -1))
|
||||
appRepoPath := tempRepoPath(in.Repo.Repo)
|
||||
s.repoLock.Lock(appRepoPath)
|
||||
defer func() {
|
||||
err := s.gitClient.Reset(appRepoPath)
|
||||
if err != nil {
|
||||
log.Warn(err)
|
||||
}
|
||||
s.repoLock.Unlock(appRepoPath)
|
||||
}()
|
||||
defer s.unlockAndResetRepoPath(appRepoPath)
|
||||
ksApp, err := s.getAppSpec(*in.Repo, appRepoPath, in.Revision, in.Path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -76,15 +70,9 @@ func ksAppToResponse(ksApp ksutil.KsonnetApp) (*KsonnetAppResponse, error) {
|
||||
}
|
||||
|
||||
func (s *Service) GenerateManifest(c context.Context, q *ManifestRequest) (*ManifestResponse, error) {
|
||||
appRepoPath := path.Join(os.TempDir(), strings.Replace(q.Repo.Repo, "/", "_", -1))
|
||||
appRepoPath := tempRepoPath(q.Repo.Repo)
|
||||
s.repoLock.Lock(appRepoPath)
|
||||
defer func() {
|
||||
err := s.gitClient.Reset(appRepoPath)
|
||||
if err != nil {
|
||||
log.Warn(err)
|
||||
}
|
||||
s.repoLock.Unlock(appRepoPath)
|
||||
}()
|
||||
defer s.unlockAndResetRepoPath(appRepoPath)
|
||||
|
||||
err := s.gitClient.CloneOrFetch(q.Repo.Repo, q.Repo.Username, q.Repo.Password, q.Repo.SSHPrivateKey, appRepoPath)
|
||||
if err != nil {
|
||||
@@ -183,7 +171,7 @@ func (s *Service) setAppLabels(target *unstructured.Unstructured, appName string
|
||||
|
||||
// GetEnvParams retrieves Ksonnet environment params in specified repo name and revision
|
||||
func (s *Service) GetEnvParams(c context.Context, q *EnvParamsRequest) (*EnvParamsResponse, error) {
|
||||
appRepoPath := path.Join(os.TempDir(), strings.Replace(q.Repo.Repo, "/", "_", -1))
|
||||
appRepoPath := tempRepoPath(q.Repo.Repo)
|
||||
s.repoLock.Lock(appRepoPath)
|
||||
defer s.repoLock.Unlock(appRepoPath)
|
||||
|
||||
@@ -211,3 +199,18 @@ func (s *Service) GetEnvParams(c context.Context, q *EnvParamsRequest) (*EnvPara
|
||||
Params: target,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// tempRepoPath returns a formulated temporary directory location to clone a repository
|
||||
func tempRepoPath(repo string) string {
|
||||
return path.Join(os.TempDir(), strings.Replace(repo, "/", "_", -1))
|
||||
}
|
||||
|
||||
// unlockAndResetRepoPath will reset any local changes in a local git repo and unlock the path
|
||||
// so that other workers can use the local repo
|
||||
func (s *Service) unlockAndResetRepoPath(appRepoPath string) {
|
||||
err := s.gitClient.Reset(appRepoPath)
|
||||
if err != nil {
|
||||
log.Warn(err)
|
||||
}
|
||||
s.repoLock.Unlock(appRepoPath)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,11 +2,13 @@ package application
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/argoproj/argo-cd/common"
|
||||
"github.com/argoproj/argo-cd/controller"
|
||||
appv1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
|
||||
appclientset "github.com/argoproj/argo-cd/pkg/client/clientset/versioned"
|
||||
"github.com/argoproj/argo-cd/reposerver"
|
||||
@@ -15,7 +17,6 @@ import (
|
||||
apirepository "github.com/argoproj/argo-cd/server/repository"
|
||||
"github.com/argoproj/argo-cd/util"
|
||||
argoutil "github.com/argoproj/argo-cd/util/argo"
|
||||
"github.com/argoproj/argo-cd/util/diff"
|
||||
"github.com/argoproj/argo-cd/util/git"
|
||||
"github.com/argoproj/argo-cd/util/kube"
|
||||
log "github.com/sirupsen/logrus"
|
||||
@@ -26,6 +27,7 @@ import (
|
||||
apierr "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
@@ -43,6 +45,7 @@ type Server struct {
|
||||
// TODO(jessesuen): move common cluster code to shared libraries
|
||||
clusterService cluster.ClusterServiceServer
|
||||
repoService apirepository.RepositoryServiceServer
|
||||
appComparator controller.AppComparator
|
||||
}
|
||||
|
||||
// NewServer returns a new instance of the Application service
|
||||
@@ -61,6 +64,7 @@ func NewServer(
|
||||
clusterService: clusterService,
|
||||
repoClientset: repoClientset,
|
||||
repoService: repoService,
|
||||
appComparator: controller.NewKsonnetAppComparator(clusterService),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,24 +338,71 @@ func (s *Server) PodLogs(q *PodLogsQuery, ws ApplicationService_PodLogsServer) e
|
||||
|
||||
// Sync syncs an application to its target state
|
||||
func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*ApplicationSyncResult, error) {
|
||||
log.Infof("Syncing application %s", syncReq.Name)
|
||||
app, err := s.Get(ctx, &ApplicationQuery{Name: syncReq.Name})
|
||||
return s.deployAndPersistDeploymentInfo(ctx, syncReq.Name, syncReq.Revision, nil, syncReq.DryRun, syncReq.Prune)
|
||||
}
|
||||
|
||||
func (s *Server) Rollback(ctx context.Context, rollbackReq *ApplicationRollbackRequest) (*ApplicationSyncResult, error) {
|
||||
app, err := s.Get(ctx, &ApplicationQuery{Name: rollbackReq.Name})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
revision := syncReq.Revision
|
||||
if revision == "" {
|
||||
var deploymentInfo *appv1.DeploymentInfo
|
||||
for _, info := range app.Status.RecentDeployments {
|
||||
if info.ID == rollbackReq.ID {
|
||||
deploymentInfo = &info
|
||||
break
|
||||
}
|
||||
}
|
||||
if deploymentInfo == nil {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "application %s does not have deployment with id %v", rollbackReq.Name, rollbackReq.ID)
|
||||
}
|
||||
return s.deployAndPersistDeploymentInfo(ctx, rollbackReq.Name, deploymentInfo.Revision, &deploymentInfo.ComponentParameterOverrides, rollbackReq.DryRun, rollbackReq.Prune)
|
||||
}
|
||||
|
||||
func (s *Server) deployAndPersistDeploymentInfo(
|
||||
ctx context.Context, appName string, revision string, overrides *[]appv1.ComponentParameter, dryRun bool, prune bool) (*ApplicationSyncResult, error) {
|
||||
|
||||
log.Infof("Syncing application %s", appName)
|
||||
app, err := s.Get(ctx, &ApplicationQuery{Name: appName})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if revision != "" {
|
||||
app.Spec.Source.TargetRevision = revision
|
||||
}
|
||||
|
||||
if overrides != nil {
|
||||
app.Spec.Source.ComponentParameterOverrides = *overrides
|
||||
}
|
||||
|
||||
res, manifest, err := s.deploy(ctx, app, dryRun, prune)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !dryRun {
|
||||
err = s.persistDeploymentInfo(ctx, appName, manifest.Revision, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (s *Server) persistDeploymentInfo(ctx context.Context, appName string, revision string, overrides *[]appv1.ComponentParameter) error {
|
||||
app, err := s.Get(ctx, &ApplicationQuery{Name: appName})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
repo := s.getRepo(ctx, app.Spec.Source.RepoURL)
|
||||
conn, repoClient, err := s.repoClientset.NewRepositoryClient()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
defer util.Close(conn)
|
||||
// set fields in v1alpha/types.go
|
||||
log.Infof("Retrieving deployment params for application %s", syncReq.Name)
|
||||
|
||||
log.Infof("Retrieving deployment params for application %s", appName)
|
||||
envParams, err := repoClient.GetEnvParams(ctx, &repository.EnvParamsRequest{
|
||||
Repo: repo,
|
||||
Environment: app.Spec.Source.Environment,
|
||||
@@ -360,37 +411,39 @@ func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*Ap
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
log.Infof("Received deployment params: %s", envParams.Params)
|
||||
|
||||
res, manifest, err := s.deploy(ctx, app.Spec.Source, app.Spec.Destination, app.Name, syncReq.DryRun)
|
||||
if err == nil {
|
||||
// Persist app deployment info
|
||||
params := make([]appv1.ComponentParameter, len(envParams.Params))
|
||||
for i := range envParams.Params {
|
||||
param := *envParams.Params[i]
|
||||
params[i] = param
|
||||
}
|
||||
app, err = s.Get(ctx, &ApplicationQuery{Name: syncReq.Name})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
app.Status.RecentDeployments = append(app.Status.RecentDeployments, appv1.DeploymentInfo{
|
||||
ComponentParameterOverrides: app.Spec.Source.ComponentParameterOverrides,
|
||||
Revision: manifest.Revision,
|
||||
Params: params,
|
||||
DeployedAt: metav1.NewTime(time.Now()),
|
||||
})
|
||||
if len(app.Status.RecentDeployments) > maxRecentDeploymentsCnt {
|
||||
app.Status.RecentDeployments = app.Status.RecentDeployments[:maxRecentDeploymentsCnt]
|
||||
}
|
||||
_, err = s.Update(ctx, app)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
params := make([]appv1.ComponentParameter, len(envParams.Params))
|
||||
for i := range envParams.Params {
|
||||
param := *envParams.Params[i]
|
||||
params[i] = param
|
||||
}
|
||||
return res, err
|
||||
var nextId int64 = 0
|
||||
if len(app.Status.RecentDeployments) > 0 {
|
||||
nextId = app.Status.RecentDeployments[len(app.Status.RecentDeployments)-1].ID + 1
|
||||
}
|
||||
recentDeployments := append(app.Status.RecentDeployments, appv1.DeploymentInfo{
|
||||
ComponentParameterOverrides: app.Spec.Source.ComponentParameterOverrides,
|
||||
Revision: revision,
|
||||
Params: params,
|
||||
DeployedAt: metav1.NewTime(time.Now()),
|
||||
ID: nextId,
|
||||
})
|
||||
if len(recentDeployments) > maxRecentDeploymentsCnt {
|
||||
recentDeployments = recentDeployments[1 : maxRecentDeploymentsCnt+1]
|
||||
}
|
||||
|
||||
patch, err := json.Marshal(map[string]map[string][]appv1.DeploymentInfo{
|
||||
"status": {
|
||||
"recentDeployments": recentDeployments,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Patch(app.Name, types.MergePatchType, patch)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Server) getApplicationDestination(ctx context.Context, name string) (string, string, error) {
|
||||
@@ -398,27 +451,24 @@ func (s *Server) getApplicationDestination(ctx context.Context, name string) (st
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
} else {
|
||||
if app.Spec.Destination != nil {
|
||||
return app.Spec.Destination.Server, app.Spec.Destination.Namespace, nil
|
||||
} else {
|
||||
repo := s.getRepo(ctx, app.Spec.Source.RepoURL)
|
||||
conn, repoClient, err := s.repoClientset.NewRepositoryClient()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
defer util.Close(conn)
|
||||
manifestInfo, err := repoClient.GenerateManifest(ctx, &repository.ManifestRequest{
|
||||
Repo: repo,
|
||||
Environment: app.Spec.Source.Environment,
|
||||
Path: app.Spec.Source.Path,
|
||||
Revision: app.Spec.Source.TargetRevision,
|
||||
AppLabel: app.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
return manifestInfo.Server, manifestInfo.Namespace, nil
|
||||
repo := s.getRepo(ctx, app.Spec.Source.RepoURL)
|
||||
conn, repoClient, err := s.repoClientset.NewRepositoryClient()
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
defer util.Close(conn)
|
||||
manifestInfo, err := repoClient.GenerateManifest(ctx, &repository.ManifestRequest{
|
||||
Repo: repo,
|
||||
Environment: app.Spec.Source.Environment,
|
||||
Path: app.Spec.Source.Path,
|
||||
Revision: app.Spec.Source.TargetRevision,
|
||||
AppLabel: app.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
server, namespace := argoutil.ResolveServerNamespace(app.Spec.Destination, manifestInfo)
|
||||
return server, namespace, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,43 +483,35 @@ func (s *Server) getRepo(ctx context.Context, repoURL string) *appv1.Repository
|
||||
|
||||
func (s *Server) deploy(
|
||||
ctx context.Context,
|
||||
source appv1.ApplicationSource,
|
||||
destination *appv1.ApplicationDestination,
|
||||
appLabel string,
|
||||
dryRun bool) (*ApplicationSyncResult, *repository.ManifestResponse, error) {
|
||||
app *appv1.Application,
|
||||
dryRun bool,
|
||||
prune bool) (*ApplicationSyncResult, *repository.ManifestResponse, error) {
|
||||
|
||||
repo := s.getRepo(ctx, source.RepoURL)
|
||||
repo := s.getRepo(ctx, app.Spec.Source.RepoURL)
|
||||
conn, repoClient, err := s.repoClientset.NewRepositoryClient()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
defer util.Close(conn)
|
||||
overrides := make([]*appv1.ComponentParameter, len(source.ComponentParameterOverrides))
|
||||
if source.ComponentParameterOverrides != nil {
|
||||
for i := range source.ComponentParameterOverrides {
|
||||
item := source.ComponentParameterOverrides[i]
|
||||
overrides := make([]*appv1.ComponentParameter, len(app.Spec.Source.ComponentParameterOverrides))
|
||||
if app.Spec.Source.ComponentParameterOverrides != nil {
|
||||
for i := range app.Spec.Source.ComponentParameterOverrides {
|
||||
item := app.Spec.Source.ComponentParameterOverrides[i]
|
||||
overrides[i] = &item
|
||||
}
|
||||
}
|
||||
|
||||
manifestInfo, err := repoClient.GenerateManifest(ctx, &repository.ManifestRequest{
|
||||
Repo: repo,
|
||||
Environment: source.Environment,
|
||||
Path: source.Path,
|
||||
Revision: source.TargetRevision,
|
||||
Environment: app.Spec.Source.Environment,
|
||||
Path: app.Spec.Source.Path,
|
||||
Revision: app.Spec.Source.TargetRevision,
|
||||
ComponentParameterOverrides: overrides,
|
||||
AppLabel: appLabel,
|
||||
AppLabel: app.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
server, namespace := argoutil.ResolveServerNamespace(destination, manifestInfo)
|
||||
|
||||
clst, err := s.clusterService.Get(ctx, &cluster.ClusterQuery{Server: server})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
config := clst.RESTConfig()
|
||||
|
||||
targetObjs := make([]*unstructured.Unstructured, len(manifestInfo.Manifests))
|
||||
for i, manifest := range manifestInfo.Manifests {
|
||||
@@ -480,46 +522,89 @@ func (s *Server) deploy(
|
||||
targetObjs[i] = obj
|
||||
}
|
||||
|
||||
liveObjs, err := kube.GetLiveResources(config, targetObjs, namespace)
|
||||
server, namespace := argoutil.ResolveServerNamespace(app.Spec.Destination, manifestInfo)
|
||||
|
||||
comparison, err := s.appComparator.CompareAppState(server, namespace, targetObjs, app)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
diffResList, err := diff.DiffArray(targetObjs, liveObjs)
|
||||
|
||||
clst, err := s.clusterService.Get(ctx, &cluster.ClusterQuery{Server: server})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
err = kube.GenerateTLSFiles(config)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
defer func() { _ = kube.DeleteTLSFiles(config) }()
|
||||
config := clst.RESTConfig()
|
||||
|
||||
var syncRes ApplicationSyncResult
|
||||
syncRes.Resources = make([]*ResourceDetails, 0)
|
||||
for i, diffRes := range diffResList.Diffs {
|
||||
for _, resourceState := range comparison.Resources {
|
||||
var liveObj, targetObj *unstructured.Unstructured
|
||||
|
||||
if resourceState.LiveState != "null" {
|
||||
liveObj = &unstructured.Unstructured{}
|
||||
err = json.Unmarshal([]byte(resourceState.LiveState), liveObj)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if resourceState.TargetState != "null" {
|
||||
targetObj = &unstructured.Unstructured{}
|
||||
err = json.Unmarshal([]byte(resourceState.TargetState), targetObj)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
needsCreate := liveObj == nil
|
||||
needsDelete := targetObj == nil
|
||||
|
||||
obj := targetObj
|
||||
if obj == nil {
|
||||
obj = liveObj
|
||||
}
|
||||
resDetails := ResourceDetails{
|
||||
Name: targetObjs[i].GetName(),
|
||||
Kind: targetObjs[i].GetKind(),
|
||||
Name: obj.GetName(),
|
||||
Kind: obj.GetKind(),
|
||||
Namespace: namespace,
|
||||
}
|
||||
needsCreate := bool(liveObjs[i] == nil)
|
||||
if !diffRes.Modified {
|
||||
|
||||
if resourceState.Status == appv1.ComparisonStatusSynced {
|
||||
resDetails.Message = fmt.Sprintf("already synced")
|
||||
} else if dryRun {
|
||||
if needsCreate {
|
||||
resDetails.Message = fmt.Sprintf("will create")
|
||||
} else if needsDelete {
|
||||
if prune {
|
||||
resDetails.Message = fmt.Sprintf("will delete")
|
||||
} else {
|
||||
resDetails.Message = fmt.Sprintf("will be ignored (should be deleted)")
|
||||
}
|
||||
} else {
|
||||
resDetails.Message = fmt.Sprintf("will update")
|
||||
}
|
||||
} else {
|
||||
_, err := kube.ApplyResource(config, targetObjs[i], namespace)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if needsCreate {
|
||||
resDetails.Message = fmt.Sprintf("created")
|
||||
if needsDelete {
|
||||
if prune {
|
||||
err = kube.DeleteResource(config, liveObj, namespace)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
resDetails.Message = fmt.Sprintf("deleted")
|
||||
} else {
|
||||
resDetails.Message = fmt.Sprintf("ignored (should be deleted)")
|
||||
}
|
||||
} else {
|
||||
resDetails.Message = fmt.Sprintf("updated")
|
||||
_, err := kube.ApplyResource(config, targetObj, namespace)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if needsCreate {
|
||||
resDetails.Message = fmt.Sprintf("created")
|
||||
} else {
|
||||
resDetails.Message = fmt.Sprintf("updated")
|
||||
}
|
||||
}
|
||||
}
|
||||
syncRes.Resources = append(syncRes.Resources, &resDetails)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -208,6 +208,37 @@ func request_ApplicationService_Sync_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
}
|
||||
|
||||
func request_ApplicationService_Rollback_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ApplicationRollbackRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := client.Rollback(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_ApplicationService_DeletePod_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeletePodQuery
|
||||
var metadata runtime.ServerMetadata
|
||||
@@ -541,6 +572,35 @@ func RegisterApplicationServiceHandlerClient(ctx context.Context, mux *runtime.S
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_ApplicationService_Rollback_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
if cn, ok := w.(http.CloseNotifier); ok {
|
||||
go func(done <-chan struct{}, closed <-chan bool) {
|
||||
select {
|
||||
case <-done:
|
||||
case <-closed:
|
||||
cancel()
|
||||
}
|
||||
}(ctx.Done(), cn.CloseNotify())
|
||||
}
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_ApplicationService_Rollback_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ApplicationService_Rollback_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_ApplicationService_DeletePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -617,6 +677,8 @@ var (
|
||||
|
||||
pattern_ApplicationService_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "applications", "name", "sync"}, ""))
|
||||
|
||||
pattern_ApplicationService_Rollback_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "applications", "name", "rollback"}, ""))
|
||||
|
||||
pattern_ApplicationService_DeletePod_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v1", "applications", "applicationName", "pods", "podName"}, ""))
|
||||
|
||||
pattern_ApplicationService_PodLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"api", "v1", "applications", "applicationName", "pods", "podName", "logs"}, ""))
|
||||
@@ -637,6 +699,8 @@ var (
|
||||
|
||||
forward_ApplicationService_Sync_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ApplicationService_Rollback_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ApplicationService_DeletePod_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ApplicationService_PodLogs_0 = runtime.ForwardResponseStream
|
||||
|
||||
@@ -32,6 +32,7 @@ message ApplicationSyncRequest {
|
||||
string name = 1;
|
||||
string revision = 2;
|
||||
bool dryRun = 3;
|
||||
bool prune = 4;
|
||||
}
|
||||
|
||||
// ApplicationSyncResult is a result of a sync requeswt
|
||||
@@ -40,6 +41,13 @@ message ApplicationSyncResult {
|
||||
repeated ResourceDetails resources = 2;
|
||||
}
|
||||
|
||||
message ApplicationRollbackRequest {
|
||||
string name = 1;
|
||||
int64 id = 2 [(gogoproto.customname) = "ID"];
|
||||
bool dryRun = 3;
|
||||
bool prune = 4;
|
||||
}
|
||||
|
||||
message ResourceDetails {
|
||||
string name = 1;
|
||||
string kind = 2;
|
||||
@@ -114,6 +122,14 @@ service ApplicationService {
|
||||
};
|
||||
}
|
||||
|
||||
// Sync syncs an application to its target state
|
||||
rpc Rollback(ApplicationRollbackRequest) returns (ApplicationSyncResult) {
|
||||
option (google.api.http) = {
|
||||
post: "/api/v1/applications/{name}/rollback"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
// PodLogs returns stream of log entries for the specified pod. Pod
|
||||
rpc DeletePod(DeletePodQuery) returns (ApplicationResponse) {
|
||||
option (google.api.http).delete = "/api/v1/applications/{applicationName}/pods/{podName}";
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: server/cluster/cluster.proto
|
||||
|
||||
/*
|
||||
Package cluster is a generated protocol buffer package.
|
||||
Package cluster is a generated protocol buffer package.
|
||||
|
||||
Cluster Service
|
||||
Cluster Service
|
||||
|
||||
Cluster Service API performs CRUD actions against cluster resources
|
||||
Cluster Service API performs CRUD actions against cluster resources
|
||||
|
||||
It is generated from these files:
|
||||
server/cluster/cluster.proto
|
||||
It is generated from these files:
|
||||
server/cluster/cluster.proto
|
||||
|
||||
It has these top-level messages:
|
||||
ClusterQuery
|
||||
ClusterResponse
|
||||
ClusterUpdateRequest
|
||||
It has these top-level messages:
|
||||
ClusterQuery
|
||||
ClusterResponse
|
||||
ClusterUpdateRequest
|
||||
*/
|
||||
package cluster
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
@@ -26,10 +26,10 @@ import _ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
import k8s_io_api_core_v1 "k8s.io/api/core/v1"
|
||||
import github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
|
||||
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
|
||||
import io "io"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@@ -40,17 +40,17 @@ var _ = math.Inf
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// ClusterQuery is a query for cluster resources
|
||||
type ClusterQuery struct {
|
||||
Server string `protobuf:"bytes,1,opt,name=server" json:"server,omitempty"`
|
||||
Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ClusterQuery) Reset() { *m = ClusterQuery{} }
|
||||
func (m *ClusterQuery) String() string { return proto.CompactTextString(m) }
|
||||
func (*ClusterQuery) ProtoMessage() {}
|
||||
func (*ClusterQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
func (*ClusterQuery) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{0} }
|
||||
|
||||
func (m *ClusterQuery) GetServer() string {
|
||||
if m != nil {
|
||||
@@ -65,17 +65,17 @@ type ClusterResponse struct {
|
||||
func (m *ClusterResponse) Reset() { *m = ClusterResponse{} }
|
||||
func (m *ClusterResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ClusterResponse) ProtoMessage() {}
|
||||
func (*ClusterResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
func (*ClusterResponse) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{1} }
|
||||
|
||||
type ClusterUpdateRequest struct {
|
||||
Server string `protobuf:"bytes,1,opt,name=server" json:"server,omitempty"`
|
||||
Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
|
||||
Cluster *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Cluster `protobuf:"bytes,2,opt,name=cluster" json:"cluster,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ClusterUpdateRequest) Reset() { *m = ClusterUpdateRequest{} }
|
||||
func (m *ClusterUpdateRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ClusterUpdateRequest) ProtoMessage() {}
|
||||
func (*ClusterUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
func (*ClusterUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorCluster, []int{2} }
|
||||
|
||||
func (m *ClusterUpdateRequest) GetServer() string {
|
||||
if m != nil {
|
||||
@@ -381,39 +381,514 @@ var _ClusterService_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "server/cluster/cluster.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("server/cluster/cluster.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 496 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xcd, 0x6e, 0xd4, 0x30,
|
||||
0x10, 0xc6, 0x05, 0xa5, 0x60, 0x10, 0x3f, 0xa3, 0x16, 0x2d, 0xd9, 0x82, 0x96, 0x08, 0x55, 0xd5,
|
||||
0x0a, 0x6c, 0x6d, 0xb9, 0xa0, 0x1e, 0x5b, 0x7e, 0x84, 0xc4, 0xa1, 0x6c, 0xe1, 0x82, 0x2a, 0x21,
|
||||
0x37, 0x19, 0xd2, 0xb0, 0x21, 0x36, 0xb6, 0x37, 0x12, 0x42, 0x08, 0x09, 0xae, 0x9c, 0xe0, 0xc8,
|
||||
0x33, 0xf0, 0x0e, 0xbc, 0x03, 0xaf, 0xc0, 0x83, 0xa0, 0x38, 0x36, 0x6d, 0xb7, 0x4a, 0x2f, 0xec,
|
||||
0x81, 0x53, 0xec, 0xb1, 0xf3, 0x7d, 0xf3, 0xcd, 0x7c, 0x1e, 0xba, 0x62, 0x50, 0xd7, 0xa8, 0x79,
|
||||
0x5a, 0x4e, 0x8d, 0x3d, 0xf8, 0x32, 0xa5, 0xa5, 0x95, 0xb0, 0xe8, 0xb7, 0xf1, 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0x07, 0xb2, 0xea, 0x28, 0x06, 0x70, 0xa3, 0x93, 0x82,
|
||||
0x2b, 0x99, 0x99, 0xcd, 0xdb, 0x2f, 0x86, 0x27, 0x4d, 0xb6, 0xa3, 0x43, 0x77, 0x2f, 0x72, 0x13,
|
||||
0xec, 0xee, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x95, 0xa3, 0x36, 0x8d, 0x05, 0x00, 0x00,
|
||||
func (m *ClusterQuery) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *ClusterQuery) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Server) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintCluster(dAtA, i, uint64(len(m.Server)))
|
||||
i += copy(dAtA[i:], m.Server)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *ClusterResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *ClusterResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *ClusterUpdateRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *ClusterUpdateRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Server) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintCluster(dAtA, i, uint64(len(m.Server)))
|
||||
i += copy(dAtA[i:], m.Server)
|
||||
}
|
||||
if m.Cluster != nil {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintCluster(dAtA, i, uint64(m.Cluster.Size()))
|
||||
n1, err := m.Cluster.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n1
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func encodeVarintCluster(dAtA []byte, offset int, v uint64) int {
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
}
|
||||
func (m *ClusterQuery) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Server)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovCluster(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *ClusterResponse) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *ClusterUpdateRequest) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Server)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovCluster(uint64(l))
|
||||
}
|
||||
if m.Cluster != nil {
|
||||
l = m.Cluster.Size()
|
||||
n += 1 + l + sovCluster(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovCluster(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
func sozCluster(x uint64) (n int) {
|
||||
return sovCluster(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *ClusterQuery) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: ClusterQuery: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: ClusterQuery: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Server", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthCluster
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Server = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipCluster(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthCluster
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *ClusterResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: ClusterResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: ClusterResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipCluster(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthCluster
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *ClusterUpdateRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: ClusterUpdateRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: ClusterUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Server", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthCluster
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Server = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthCluster
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Cluster == nil {
|
||||
m.Cluster = &github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Cluster{}
|
||||
}
|
||||
if err := m.Cluster.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipCluster(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthCluster
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipCluster(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
iNdEx += length
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthCluster
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowCluster
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
innerWire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
innerWireType := int(innerWire & 0x7)
|
||||
if innerWireType == 4 {
|
||||
break
|
||||
}
|
||||
next, err := skipCluster(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthCluster = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowCluster = fmt.Errorf("proto: integer overflow")
|
||||
)
|
||||
|
||||
func init() { proto.RegisterFile("server/cluster/cluster.proto", fileDescriptorCluster) }
|
||||
|
||||
var fileDescriptorCluster = []byte{
|
||||
// 510 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x4f, 0x6b, 0x14, 0x31,
|
||||
0x14, 0x37, 0x55, 0xa6, 0x1a, 0xc5, 0x3f, 0xa1, 0x95, 0x75, 0xb6, 0x2e, 0xeb, 0x20, 0xa5, 0x2c,
|
||||
0x98, 0xb0, 0xf5, 0x52, 0x7a, 0x6c, 0xfd, 0x83, 0xe0, 0xa1, 0x6e, 0xf5, 0x22, 0x05, 0x49, 0x67,
|
||||
0x9e, 0xd3, 0x71, 0xc7, 0x49, 0x4c, 0xb2, 0x03, 0x22, 0x22, 0xe8, 0xd5, 0x93, 0x1e, 0xfd, 0x0c,
|
||||
0x7e, 0x07, 0x8f, 0x1e, 0x05, 0xbf, 0x80, 0x2c, 0x7e, 0x10, 0x99, 0x4c, 0x62, 0xdb, 0x2d, 0xb3,
|
||||
0x17, 0xe7, 0xe0, 0x69, 0x92, 0x97, 0xcc, 0xef, 0xf7, 0x7e, 0xef, 0xfd, 0xf2, 0xf0, 0x8a, 0x06,
|
||||
0x55, 0x82, 0x62, 0x71, 0x3e, 0xd1, 0xe6, 0xf0, 0x4b, 0xa5, 0x12, 0x46, 0x90, 0x45, 0xb7, 0x0d,
|
||||
0x97, 0x52, 0x91, 0x0a, 0x1b, 0x63, 0xd5, 0xaa, 0x3e, 0x0e, 0x57, 0x52, 0x21, 0xd2, 0x1c, 0x18,
|
||||
0x97, 0x19, 0xe3, 0x45, 0x21, 0x0c, 0x37, 0x99, 0x28, 0xb4, 0x3b, 0x8d, 0xc6, 0x1b, 0x9a, 0x66,
|
||||
0xc2, 0x9e, 0xc6, 0x42, 0x01, 0x2b, 0x87, 0x2c, 0x85, 0x02, 0x14, 0x37, 0x90, 0xb8, 0x3b, 0x0f,
|
||||
0xd2, 0xcc, 0x1c, 0x4c, 0xf6, 0x69, 0x2c, 0x5e, 0x32, 0xae, 0x2c, 0xc5, 0x0b, 0xbb, 0xb8, 0x15,
|
||||
0x27, 0x4c, 0x8e, 0xd3, 0xea, 0x67, 0xcd, 0xb8, 0x94, 0x79, 0x16, 0x5b, 0x70, 0x56, 0x0e, 0x79,
|
||||
0x2e, 0x0f, 0xf8, 0x09, 0xa8, 0x68, 0x15, 0x5f, 0xd8, 0xae, 0xb3, 0x7d, 0x34, 0x01, 0xf5, 0x9a,
|
||||
0x5c, 0xc5, 0x41, 0xad, 0xad, 0x83, 0xfa, 0x68, 0xed, 0xdc, 0xc8, 0xed, 0xa2, 0x2b, 0xf8, 0x92,
|
||||
0xbb, 0x37, 0x02, 0x2d, 0x45, 0xa1, 0x21, 0xfa, 0x88, 0xf0, 0x92, 0x8b, 0x3d, 0x91, 0x09, 0x37,
|
||||
0x30, 0x82, 0x57, 0x13, 0xd0, 0xa6, 0x09, 0x83, 0xec, 0x61, 0x5f, 0x99, 0xce, 0x42, 0x1f, 0xad,
|
||||
0x9d, 0x5f, 0xdf, 0xa2, 0x87, 0x42, 0xa8, 0x17, 0x62, 0x17, 0xcf, 0xe2, 0x84, 0xca, 0x71, 0x4a,
|
||||
0x2b, 0x21, 0xf4, 0x88, 0x10, 0xea, 0x85, 0x50, 0x9f, 0x8d, 0x87, 0x5c, 0xff, 0xb6, 0x88, 0x2f,
|
||||
0xba, 0xe0, 0x2e, 0xa8, 0x32, 0x8b, 0x81, 0xbc, 0xc3, 0x67, 0x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 0xbe, 0x4f, 0x7b, 0xe8, 0xc7, 0xb4, 0x87,
|
||||
0x7e, 0x4d, 0x7b, 0xe8, 0xe9, 0x60, 0xde, 0x94, 0x3b, 0x3e, 0x80, 0xf7, 0x03, 0x3b, 0xcd, 0x6e,
|
||||
0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x25, 0x28, 0x85, 0xfb, 0x99, 0x05, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: server/repository/repository.proto
|
||||
|
||||
/*
|
||||
Package repository is a generated protocol buffer package.
|
||||
Package repository is a generated protocol buffer package.
|
||||
|
||||
Repository Service
|
||||
Repository Service
|
||||
|
||||
Repository Service API performs CRUD actions against repository resources
|
||||
Repository Service API performs CRUD actions against repository resources
|
||||
|
||||
It is generated from these files:
|
||||
server/repository/repository.proto
|
||||
It is generated from these files:
|
||||
server/repository/repository.proto
|
||||
|
||||
It has these top-level messages:
|
||||
RepoQuery
|
||||
RepoResponse
|
||||
RepoUpdateRequest
|
||||
It has these top-level messages:
|
||||
RepoQuery
|
||||
RepoResponse
|
||||
RepoUpdateRequest
|
||||
*/
|
||||
package repository
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
@@ -26,10 +26,10 @@ import _ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
import _ "k8s.io/api/core/v1"
|
||||
import github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
|
||||
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
|
||||
import io "io"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@@ -40,17 +40,17 @@ var _ = math.Inf
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// RepoQuery is a query for Repository resources
|
||||
type RepoQuery struct {
|
||||
Repo string `protobuf:"bytes,1,opt,name=repo" json:"repo,omitempty"`
|
||||
Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
|
||||
}
|
||||
|
||||
func (m *RepoQuery) Reset() { *m = RepoQuery{} }
|
||||
func (m *RepoQuery) String() string { return proto.CompactTextString(m) }
|
||||
func (*RepoQuery) ProtoMessage() {}
|
||||
func (*RepoQuery) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
func (*RepoQuery) Descriptor() ([]byte, []int) { return fileDescriptorRepository, []int{0} }
|
||||
|
||||
func (m *RepoQuery) GetRepo() string {
|
||||
if m != nil {
|
||||
@@ -65,17 +65,17 @@ type RepoResponse struct {
|
||||
func (m *RepoResponse) Reset() { *m = RepoResponse{} }
|
||||
func (m *RepoResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*RepoResponse) ProtoMessage() {}
|
||||
func (*RepoResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
func (*RepoResponse) Descriptor() ([]byte, []int) { return fileDescriptorRepository, []int{1} }
|
||||
|
||||
type RepoUpdateRequest struct {
|
||||
Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
|
||||
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
|
||||
Repo *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Repository `protobuf:"bytes,2,opt,name=repo" json:"repo,omitempty"`
|
||||
}
|
||||
|
||||
func (m *RepoUpdateRequest) Reset() { *m = RepoUpdateRequest{} }
|
||||
func (m *RepoUpdateRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*RepoUpdateRequest) ProtoMessage() {}
|
||||
func (*RepoUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
func (*RepoUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRepository, []int{2} }
|
||||
|
||||
func (m *RepoUpdateRequest) GetUrl() string {
|
||||
if m != nil {
|
||||
@@ -346,38 +346,513 @@ var _RepositoryService_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "server/repository/repository.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("server/repository/repository.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 470 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x41, 0x6b, 0x14, 0x31,
|
||||
0x14, 0xc7, 0x4d, 0x5b, 0x06, 0x1a, 0x45, 0xf4, 0x51, 0xa5, 0x8e, 0x2d, 0x2d, 0xf1, 0xb2, 0x14,
|
||||
0x9a, 0xb0, 0xf5, 0x22, 0x3d, 0xaa, 0x45, 0x0a, 0x5e, 0x9c, 0xea, 0x41, 0x0f, 0x4a, 0x3a, 0xfb,
|
||||
0x98, 0xc6, 0x1d, 0x27, 0x31, 0xc9, 0x0c, 0x14, 0x29, 0x88, 0x07, 0xf1, 0xee, 0xc5, 0x83, 0xdf,
|
||||
0xc3, 0x0f, 0xe2, 0x57, 0xf0, 0x5b, 0x78, 0x91, 0x64, 0xa6, 0xbb, 0x6b, 0xbb, 0xed, 0x69, 0x0e,
|
||||
0xbd, 0xfd, 0xe7, 0x4d, 0xf2, 0xf2, 0xcb, 0xff, 0xe5, 0x3d, 0xca, 0x1c, 0xda, 0x06, 0xad, 0xb0,
|
||||
0x68, 0xb4, 0x53, 0x5e, 0xdb, 0xe3, 0x19, 0xc9, 0x8d, 0xd5, 0x5e, 0x03, 0x9d, 0x46, 0xd2, 0x95,
|
||||
0x42, 0x17, 0x3a, 0x86, 0x45, 0x50, 0xed, 0x8a, 0x74, 0xad, 0xd0, 0xba, 0x28, 0x51, 0x48, 0xa3,
|
||||
0x84, 0xac, 0x2a, 0xed, 0xa5, 0x57, 0xba, 0x72, 0xdd, 0x5f, 0x36, 0x7e, 0xe4, 0xb8, 0xd2, 0xf1,
|
||||
0x6f, 0xae, 0x2d, 0x8a, 0x66, 0x28, 0x0a, 0xac, 0xd0, 0x4a, 0x8f, 0xa3, 0x6e, 0xcd, 0x7e, 0xa1,
|
||||
0xfc, 0x51, 0x7d, 0xc8, 0x73, 0xfd, 0x41, 0x48, 0x1b, 0x8f, 0x78, 0x1f, 0xc5, 0x76, 0x3e, 0x12,
|
||||
0x66, 0x5c, 0x84, 0xcd, 0x4e, 0x48, 0x63, 0x4a, 0x95, 0xc7, 0xe4, 0xa2, 0x19, 0xca, 0xd2, 0x1c,
|
||||
0xc9, 0x73, 0xa9, 0xd8, 0x06, 0x5d, 0xce, 0xd0, 0xe8, 0x17, 0x35, 0xda, 0x63, 0x00, 0xba, 0x14,
|
||||
0xe8, 0x57, 0xc9, 0x26, 0x19, 0x2c, 0x67, 0x51, 0xb3, 0x9b, 0xf4, 0x46, 0x58, 0x90, 0xa1, 0x33,
|
||||
0xba, 0x72, 0xc8, 0x3e, 0x13, 0x7a, 0x3b, 0x04, 0x5e, 0x99, 0x91, 0xf4, 0x98, 0xe1, 0xc7, 0x1a,
|
||||
0x9d, 0x87, 0x5b, 0x74, 0xb1, 0xb6, 0x65, 0xb7, 0x31, 0x48, 0x78, 0xdd, 0xe5, 0x5a, 0xd8, 0x24,
|
||||
0x83, 0xeb, 0x3b, 0x7b, 0x7c, 0x8a, 0xcc, 0x4f, 0x91, 0xa3, 0x78, 0x97, 0x8f, 0xb8, 0x19, 0x17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d, 0x9f,
|
||||
0x73, 0x23, 0xf2, 0x30, 0x89, 0x93, 0xe6, 0xe1, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x0a,
|
||||
0x51, 0x7f, 0x3e, 0x05, 0x00, 0x00,
|
||||
func (m *RepoQuery) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *RepoQuery) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Repo) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintRepository(dAtA, i, uint64(len(m.Repo)))
|
||||
i += copy(dAtA[i:], m.Repo)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *RepoResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *RepoResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *RepoUpdateRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *RepoUpdateRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Url) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintRepository(dAtA, i, uint64(len(m.Url)))
|
||||
i += copy(dAtA[i:], m.Url)
|
||||
}
|
||||
if m.Repo != nil {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintRepository(dAtA, i, uint64(m.Repo.Size()))
|
||||
n1, err := m.Repo.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n1
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func encodeVarintRepository(dAtA []byte, offset int, v uint64) int {
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
}
|
||||
func (m *RepoQuery) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Repo)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovRepository(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *RepoResponse) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *RepoUpdateRequest) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Url)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovRepository(uint64(l))
|
||||
}
|
||||
if m.Repo != nil {
|
||||
l = m.Repo.Size()
|
||||
n += 1 + l + sovRepository(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovRepository(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
func sozRepository(x uint64) (n int) {
|
||||
return sovRepository(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *RepoQuery) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: RepoQuery: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: RepoQuery: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Repo", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthRepository
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Repo = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipRepository(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthRepository
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *RepoResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: RepoResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: RepoResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipRepository(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthRepository
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *RepoUpdateRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: RepoUpdateRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: RepoUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthRepository
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Url = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Repo", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthRepository
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Repo == nil {
|
||||
m.Repo = &github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Repository{}
|
||||
}
|
||||
if err := m.Repo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipRepository(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthRepository
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipRepository(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
iNdEx += length
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthRepository
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowRepository
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
innerWire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
innerWireType := int(innerWire & 0x7)
|
||||
if innerWireType == 4 {
|
||||
break
|
||||
}
|
||||
next, err := skipRepository(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthRepository = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowRepository = fmt.Errorf("proto: integer overflow")
|
||||
)
|
||||
|
||||
func init() { proto.RegisterFile("server/repository/repository.proto", fileDescriptorRepository) }
|
||||
|
||||
var fileDescriptorRepository = []byte{
|
||||
// 486 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0x41, 0x6b, 0x14, 0x31,
|
||||
0x14, 0xc7, 0x4d, 0x5b, 0x06, 0x1a, 0x45, 0x34, 0x54, 0xa9, 0x63, 0xbb, 0x2d, 0xf1, 0xb2, 0x14,
|
||||
0x9a, 0xb0, 0xf5, 0x22, 0xf5, 0xa6, 0x16, 0x29, 0x78, 0x71, 0xaa, 0x07, 0x3d, 0x28, 0xe9, 0xcc,
|
||||
0x63, 0x1a, 0x77, 0x9c, 0xc4, 0x24, 0x33, 0x50, 0xa4, 0x20, 0x1e, 0xc4, 0xbb, 0x17, 0x0f, 0x7e,
|
||||
0x0f, 0xbf, 0x82, 0x47, 0xc1, 0x2f, 0x20, 0x8b, 0xdf, 0xc2, 0x8b, 0x24, 0x33, 0xdd, 0x5d, 0xdb,
|
||||
0x6d, 0x4f, 0x73, 0xe8, 0xed, 0x3f, 0x6f, 0x92, 0x97, 0x5f, 0xfe, 0x2f, 0xef, 0x61, 0x6a, 0xc1,
|
||||
0xd4, 0x60, 0xb8, 0x01, 0xad, 0xac, 0x74, 0xca, 0x1c, 0x4e, 0x49, 0xa6, 0x8d, 0x72, 0x8a, 0xe0,
|
||||
0x49, 0x24, 0x5e, 0xca, 0x55, 0xae, 0x42, 0x98, 0x7b, 0xd5, 0xac, 0x88, 0x57, 0x72, 0xa5, 0xf2,
|
||||
0x02, 0xb8, 0xd0, 0x92, 0x8b, 0xb2, 0x54, 0x4e, 0x38, 0xa9, 0x4a, 0xdb, 0xfe, 0xa5, 0xc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+1,24 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: server/session/session.proto
|
||||
|
||||
/*
|
||||
Package session is a generated protocol buffer package.
|
||||
Package session is a generated protocol buffer package.
|
||||
|
||||
Session Service
|
||||
Session Service
|
||||
|
||||
Session Service API performs CRUD actions against session resources
|
||||
Session Service API performs CRUD actions against session resources
|
||||
|
||||
It is generated from these files:
|
||||
server/session/session.proto
|
||||
It is generated from these files:
|
||||
server/session/session.proto
|
||||
|
||||
It has these top-level messages:
|
||||
SessionCreateRequest
|
||||
SessionDeleteRequest
|
||||
SessionResponse
|
||||
It has these top-level messages:
|
||||
SessionCreateRequest
|
||||
SessionDeleteRequest
|
||||
SessionResponse
|
||||
*/
|
||||
package session
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
@@ -26,10 +26,10 @@ import _ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
import _ "k8s.io/api/core/v1"
|
||||
import _ "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
|
||||
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
|
||||
import io "io"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@@ -40,18 +40,18 @@ var _ = math.Inf
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// SessionCreateRequest is for logging in.
|
||||
type SessionCreateRequest struct {
|
||||
Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
|
||||
Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
|
||||
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SessionCreateRequest) Reset() { *m = SessionCreateRequest{} }
|
||||
func (m *SessionCreateRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SessionCreateRequest) ProtoMessage() {}
|
||||
func (*SessionCreateRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
func (*SessionCreateRequest) Descriptor() ([]byte, []int) { return fileDescriptorSession, []int{0} }
|
||||
|
||||
func (m *SessionCreateRequest) GetUsername() string {
|
||||
if m != nil {
|
||||
@@ -74,17 +74,17 @@ type SessionDeleteRequest struct {
|
||||
func (m *SessionDeleteRequest) Reset() { *m = SessionDeleteRequest{} }
|
||||
func (m *SessionDeleteRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SessionDeleteRequest) ProtoMessage() {}
|
||||
func (*SessionDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
func (*SessionDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorSession, []int{1} }
|
||||
|
||||
// SessionResponse wraps the created token or returns an empty string if deleted.
|
||||
type SessionResponse struct {
|
||||
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
|
||||
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SessionResponse) Reset() { *m = SessionResponse{} }
|
||||
func (m *SessionResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*SessionResponse) ProtoMessage() {}
|
||||
func (*SessionResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
func (*SessionResponse) Descriptor() ([]byte, []int) { return fileDescriptorSession, []int{2} }
|
||||
|
||||
func (m *SessionResponse) GetToken() string {
|
||||
if m != nil {
|
||||
@@ -208,29 +208,496 @@ var _SessionService_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "server/session/session.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("server/session/session.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 333 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xbf, 0x4e, 0xc3, 0x30,
|
||||
0x10, 0xc6, 0x95, 0x4a, 0x14, 0xf0, 0x40, 0x45, 0x14, 0x41, 0x15, 0x15, 0x09, 0x65, 0x01, 0x55,
|
||||
0x10, 0xab, 0xb0, 0x20, 0x46, 0x60, 0x61, 0x61, 0x68, 0xb7, 0x4a, 0x0c, 0x6e, 0x7a, 0x72, 0x4d,
|
||||
0x53, 0x9f, 0xf1, 0xb9, 0x61, 0xe7, 0x15, 0x78, 0x2c, 0x46, 0x5e, 0x81, 0x07, 0x41, 0x75, 0xfe,
|
||||
0x48, 0x6d, 0x51, 0xa7, 0xf8, 0xf3, 0x77, 0xf9, 0xdd, 0x97, 0xbb, 0xb0, 0x1e, 0x81, 0x2d, 0xc0,
|
||||
0x72, 0x02, 0x22, 0x85, 0xba, 0x7e, 0xa6, 0xc6, 0xa2, 0xc3, 0x70, 0xbf, 0x92, 0x71, 0x24, 0x51,
|
||||
0xa2, 0xbf, 0xe3, 0xab, 0x53, 0x69, 0xc7, 0x3d, 0x89, 0x28, 0x73, 0xe0, 0xc2, 0x28, 0x2e, 0xb4,
|
||||
0x46, 0x27, 0x9c, 0x42, 0x4d, 0x95, 0x9b, 0xcc, 0xef, 0x28, 0x55, 0xe8, 0xdd, 0x0c, 0x2d, 0xf0,
|
||||
0x62, 0xc0, 0x25, 0x68, 0xb0, 0xc2, 0xc1, 0xb4, 0xaa, 0x79, 0x96,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, 0xff, 0x8d, 0x26, 0x6d, 0xbf, 0x93, 0xdb, 0xbf,
|
||||
0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x2e, 0x17, 0xeb, 0x5f, 0x02, 0x00, 0x00,
|
||||
func (m *SessionCreateRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *SessionCreateRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Username) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintSession(dAtA, i, uint64(len(m.Username)))
|
||||
i += copy(dAtA[i:], m.Username)
|
||||
}
|
||||
if len(m.Password) > 0 {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintSession(dAtA, i, uint64(len(m.Password)))
|
||||
i += copy(dAtA[i:], m.Password)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *SessionDeleteRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *SessionDeleteRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *SessionResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *SessionResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Token) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintSession(dAtA, i, uint64(len(m.Token)))
|
||||
i += copy(dAtA[i:], m.Token)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func encodeVarintSession(dAtA []byte, offset int, v uint64) int {
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
}
|
||||
func (m *SessionCreateRequest) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Username)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovSession(uint64(l))
|
||||
}
|
||||
l = len(m.Password)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovSession(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *SessionDeleteRequest) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *SessionResponse) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Token)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovSession(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovSession(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
func sozSession(x uint64) (n int) {
|
||||
return sovSession(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *SessionCreateRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: SessionCreateRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: SessionCreateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthSession
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Username = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthSession
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Password = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipSession(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthSession
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *SessionDeleteRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: SessionDeleteRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: SessionDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipSession(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthSession
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *SessionResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: SessionResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: SessionResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthSession
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Token = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipSession(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthSession
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipSession(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
iNdEx += length
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthSession
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowSession
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
innerWire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
innerWireType := int(innerWire & 0x7)
|
||||
if innerWireType == 4 {
|
||||
break
|
||||
}
|
||||
next, err := skipSession(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthSession = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowSession = fmt.Errorf("proto: integer overflow")
|
||||
)
|
||||
|
||||
func init() { proto.RegisterFile("server/session/session.proto", fileDescriptorSession) }
|
||||
|
||||
var fileDescriptorSession = []byte{
|
||||
// 349 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x4a, 0xfb, 0x40,
|
||||
0x10, 0xc6, 0xd9, 0xc2, 0xbf, 0x7f, 0xdd, 0x83, 0xc5, 0x10, 0xb4, 0x84, 0x5a, 0x24, 0x17, 0xa5,
|
||||
0x60, 0x96, 0xea, 0xa5, 0x78, 0x54, 0x2f, 0x5e, 0x3c, 0xb4, 0xb7, 0x82, 0x87, 0x6d, 0x3a, 0x6c,
|
||||
0xd7, 0xa6, 0x3b, 0xeb, 0xee, 0x36, 0xde, 0x7d, 0x05, 0x5f, 0x4a, 0xf0, 0x22, 0xf8, 0x02, 0x52,
|
||||
0x7c, 0x10, 0xe9, 0x26, 0x29, 0xb4, 0x95, 0x9e, 0xb2, 0xdf, 0x7e, 0x93, 0xdf, 0x7c, 0x99, 0x09,
|
||||
0x6d, 0x59, 0x30, 0x39, 0x18, 0x66, 0xc1, 0x5a, 0x89, 0xaa, 0x7a, 0x26, 0xda, 0xa0, 0xc3, 0xe0,
|
||||
0x7f, 0x29, 0xa3, 0x50, 0xa0, 0x40, 0x7f, 0xc7, 0x96, 0xa7, 0xc2, 0x8e, 0x5a, 0x02, 0x51, 0x64,
|
||||
0xc0, 0xb8, 0x96, 0x8c, 0x2b, 0x85, 0x8e, 0x3b, 0x89, 0xca, 0x96, 0x6e, 0x3c, 0xed, 0xd9, 0x44,
|
||||
0xa2, 0x77, 0x53, 0x34, 0xc0, 0xf2, 0x2e, 0x13, 0xa0, 0xc0, 0x70, 0x07, 0xe3, 0xb2, 0xe6, 0x5e,
|
||||
0x48, 0x37, 0x99, 0x8f, 0x92, 0x14, 0x67, 0x8c, 0x1b, 0xdf, 0xe2, 0xc9, 0x1f, 0x2e, 0xd2, 0x31,
|
||||
0xd3, 0x53, 0xb1, 0x7c, 0xd9, 0x32, 0xae, 0x75, 0x26, 0x53, 0x0f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8, 0xb8, 0x6b, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: server/version/version.proto
|
||||
|
||||
/*
|
||||
Package version is a generated protocol buffer package.
|
||||
Package version is a generated protocol buffer package.
|
||||
|
||||
Version Service
|
||||
Version Service
|
||||
|
||||
Version Service API returns the version of the API server.
|
||||
Version Service API returns the version of the API server.
|
||||
|
||||
It is generated from these files:
|
||||
server/version/version.proto
|
||||
It is generated from these files:
|
||||
server/version/version.proto
|
||||
|
||||
It has these top-level messages:
|
||||
VersionMessage
|
||||
It has these top-level messages:
|
||||
VersionMessage
|
||||
*/
|
||||
package version
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
|
||||
|
||||
import (
|
||||
context "golang.org/x/net/context"
|
||||
grpc "google.golang.org/grpc"
|
||||
)
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
|
||||
import io "io"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
@@ -36,24 +36,24 @@ var _ = math.Inf
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// VersionMessage represents version of the ArgoCD API server
|
||||
type VersionMessage struct {
|
||||
Version string `protobuf:"bytes,1,opt,name=Version" json:"Version,omitempty"`
|
||||
BuildDate string `protobuf:"bytes,2,opt,name=BuildDate" json:"BuildDate,omitempty"`
|
||||
GitCommit string `protobuf:"bytes,3,opt,name=GitCommit" json:"GitCommit,omitempty"`
|
||||
GitTag string `protobuf:"bytes,4,opt,name=GitTag" json:"GitTag,omitempty"`
|
||||
GitTreeState string `protobuf:"bytes,5,opt,name=GitTreeState" json:"GitTreeState,omitempty"`
|
||||
GoVersion string `protobuf:"bytes,6,opt,name=GoVersion" json:"GoVersion,omitempty"`
|
||||
Compiler string `protobuf:"bytes,7,opt,name=Compiler" json:"Compiler,omitempty"`
|
||||
Platform string `protobuf:"bytes,8,opt,name=Platform" json:"Platform,omitempty"`
|
||||
Version string `protobuf:"bytes,1,opt,name=Version,proto3" json:"Version,omitempty"`
|
||||
BuildDate string `protobuf:"bytes,2,opt,name=BuildDate,proto3" json:"BuildDate,omitempty"`
|
||||
GitCommit string `protobuf:"bytes,3,opt,name=GitCommit,proto3" json:"GitCommit,omitempty"`
|
||||
GitTag string `protobuf:"bytes,4,opt,name=GitTag,proto3" json:"GitTag,omitempty"`
|
||||
GitTreeState string `protobuf:"bytes,5,opt,name=GitTreeState,proto3" json:"GitTreeState,omitempty"`
|
||||
GoVersion string `protobuf:"bytes,6,opt,name=GoVersion,proto3" json:"GoVersion,omitempty"`
|
||||
Compiler string `protobuf:"bytes,7,opt,name=Compiler,proto3" json:"Compiler,omitempty"`
|
||||
Platform string `protobuf:"bytes,8,opt,name=Platform,proto3" json:"Platform,omitempty"`
|
||||
}
|
||||
|
||||
func (m *VersionMessage) Reset() { *m = VersionMessage{} }
|
||||
func (m *VersionMessage) String() string { return proto.CompactTextString(m) }
|
||||
func (*VersionMessage) ProtoMessage() {}
|
||||
func (*VersionMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
func (*VersionMessage) Descriptor() ([]byte, []int) { return fileDescriptorVersion, []int{0} }
|
||||
|
||||
func (m *VersionMessage) GetVersion() string {
|
||||
if m != nil {
|
||||
@@ -189,28 +189,542 @@ var _VersionService_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "server/version/version.proto",
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("server/version/version.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 310 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xcd, 0x4a, 0x03, 0x31,
|
||||
0x14, 0x85, 0x69, 0xd5, 0xfe, 0x84, 0xd2, 0x45, 0x90, 0x1a, 0xc6, 0x2e, 0xa4, 0x2b, 0x11, 0x9d,
|
||||
0x80, 0xbe, 0x41, 0xab, 0x74, 0x25, 0x14, 0x2b, 0x2e, 0xdc, 0x65, 0xda, 0xdb, 0x18, 0x99, 0xcc,
|
||||
0x1d, 0x32, 0x69, 0xc1, 0xad, 0xaf, 0xe0, 0xa3, 0xf9, 0x0a, 0x3e, 0x84, 0x4b, 0x99, 0xfc, 0x8c,
|
||||
0xcc, 0x6a, 0x72, 0xce, 0x17, 0xce, 0xe4, 0x9e, 0x4b, 0xa6, 0x15, 0x98, 0x03, 0x18, 0x7e, 0x00,
|
||||
0x53, 0x29, 0x2c, 0xe2, 0x37, 0x2d, 0x0d, 0x5a, 0xa4, 0xfd, 0x20, 0x93, 0xa9, 0x44, 0x94, 0x39,
|
||||
0x70, 0x51, 0x2a, 0x2e, 0x8a, 0x02, 0xad, 0xb0, 0x0a, 0x8b, 0xca, 0x5f, 0x4b, 0xce, 0x03, 0x75,
|
||||
0x2a, 0xdb, 0xef, 0x38, 0xe8, 0xd2, 0x7e, 0x78, 0x38, 0xfb, 0xed, 0x90, 0xf1, 0x8b, 0x8f, 0x79,
|
||||
0x84, 0xaa, 0x12, 0x12, 0x28, 0x23, 0xfd, 0xe0, 0xb0, 0xce, 0x45, 0xe7, 0x72, 0xf8, 0x14, 0x25,
|
||||
0x9d, 0x92, 0xe1, 0x7c, 0xaf, 0xf2, 0xed, 0xbd, 0xb0, 0xc0, 0xba, 0x8e, 0xfd, 0x1b, 0x35, 0x5d,
|
||||
0x2a, 0xbb, 0x40, 0xad, 0x95, 0x65, 0x47, 0x9e, 0x36, 0x06, 0x9d, 0x90, 0xde, 0x52, 0xd9, 0x67,
|
||||
0x21, 0xd9, 0xb1, 0x43, 0x41, 0xd1, 0x19, 0x19, 0xd5, 0x27, 0x03, 0xb0, 0xb6, 0x75, 0xec, 0x89,
|
||||
0xa3, 0x2d, 0xcf, 0x25, 0x63, 0x7c, 0x53, 0x2f, 0x24, 0x47, 0x83, 0x26, 0x64, 0xb0, 0x40, 0x5d,
|
||||
0xaa, 0x1c, 0x0c, 0xeb, 0x3b, 0xd8, 0xe8, 0x9a, 0xad, 0x72, 0x61, 0x77, 0x68, 0x34, 0x1b, 0x78,
|
||||
0x16, 0xf5, 0x6d, 0xd6, 0x4c, 0xbe, 0x06, 0x73, 0x50, 0x1b, 0xa0, 0xab, 0x66, 0x72, 0x3a, 0x49,
|
||||
0x7d, 0x6b, 0x69, 0x6c, 0x2d, 0x7d, 0xa8, 0x5b, 0x4b, 0xce, 0xd2, 0xb8, 0x83, 0x76, 0x6b, 0xb3,
|
||||
0xd3, 0xcf, 0xef, 0x9f, 0xaf, 0xee, 0x98, 0x8e, 0xdc, 0x16, 0xc2, 0xa5, 0xf9, 0xf5, 0xeb, 0x95,
|
||||
0x54, 0xf6, 0x6d, 0x9f, 0xa5, 0x1b, 0xd4, 0x5c, 0x18, 0x89, 0xa5, 0xc1, 0x77, 0x77, 0xb8, 0xd9,
|
||||
0x6c, 0x79, 0x7b, 0xbd, 0x59, 0xcf, 0xfd, 0xec, 0xee, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x45, 0x81,
|
||||
0x09, 0xaf, 0xf7, 0x01, 0x00, 0x00,
|
||||
func (m *VersionMessage) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *VersionMessage) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Version) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.Version)))
|
||||
i += copy(dAtA[i:], m.Version)
|
||||
}
|
||||
if len(m.BuildDate) > 0 {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.BuildDate)))
|
||||
i += copy(dAtA[i:], m.BuildDate)
|
||||
}
|
||||
if len(m.GitCommit) > 0 {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.GitCommit)))
|
||||
i += copy(dAtA[i:], m.GitCommit)
|
||||
}
|
||||
if len(m.GitTag) > 0 {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.GitTag)))
|
||||
i += copy(dAtA[i:], m.GitTag)
|
||||
}
|
||||
if len(m.GitTreeState) > 0 {
|
||||
dAtA[i] = 0x2a
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.GitTreeState)))
|
||||
i += copy(dAtA[i:], m.GitTreeState)
|
||||
}
|
||||
if len(m.GoVersion) > 0 {
|
||||
dAtA[i] = 0x32
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.GoVersion)))
|
||||
i += copy(dAtA[i:], m.GoVersion)
|
||||
}
|
||||
if len(m.Compiler) > 0 {
|
||||
dAtA[i] = 0x3a
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.Compiler)))
|
||||
i += copy(dAtA[i:], m.Compiler)
|
||||
}
|
||||
if len(m.Platform) > 0 {
|
||||
dAtA[i] = 0x42
|
||||
i++
|
||||
i = encodeVarintVersion(dAtA, i, uint64(len(m.Platform)))
|
||||
i += copy(dAtA[i:], m.Platform)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func encodeVarintVersion(dAtA []byte, offset int, v uint64) int {
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
}
|
||||
func (m *VersionMessage) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Version)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
l = len(m.BuildDate)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
l = len(m.GitCommit)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
l = len(m.GitTag)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
l = len(m.GitTreeState)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
l = len(m.GoVersion)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
l = len(m.Compiler)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
l = len(m.Platform)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovVersion(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovVersion(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
func sozVersion(x uint64) (n int) {
|
||||
return sovVersion(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *VersionMessage) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: VersionMessage: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: VersionMessage: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Version = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field BuildDate", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.BuildDate = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field GitCommit", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.GitCommit = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field GitTag", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.GitTag = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field GitTreeState", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.GitTreeState = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field GoVersion", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.GoVersion = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 7:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Compiler", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Compiler = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 8:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Platform", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Platform = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipVersion(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthVersion
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipVersion(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
iNdEx += length
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthVersion
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowVersion
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
innerWire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
innerWireType := int(innerWire & 0x7)
|
||||
if innerWireType == 4 {
|
||||
break
|
||||
}
|
||||
next, err := skipVersion(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthVersion = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowVersion = fmt.Errorf("proto: integer overflow")
|
||||
)
|
||||
|
||||
func init() { proto.RegisterFile("server/version/version.proto", fileDescriptorVersion) }
|
||||
|
||||
var fileDescriptorVersion = []byte{
|
||||
// 327 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xcd, 0x4a, 0xfb, 0x40,
|
||||
0x14, 0xc5, 0x49, 0xff, 0x7f, 0xfb, 0x31, 0x94, 0x2e, 0x06, 0xa9, 0x43, 0x2c, 0x45, 0xba, 0x12,
|
||||
0xc1, 0x04, 0x74, 0xe3, 0xba, 0x55, 0xba, 0x12, 0x8a, 0x15, 0x17, 0xee, 0x26, 0xed, 0x6d, 0x1c,
|
||||
0xc9, 0xe4, 0x86, 0xc9, 0xb4, 0xe0, 0xd6, 0x57, 0xf0, 0xa5, 0x5c, 0x0a, 0xbe, 0x80, 0x14, 0x1f,
|
||||
0xc2, 0xa5, 0x64, 0x3e, 0x22, 0x59, 0x65, 0xce, 0xf9, 0x0d, 0x27, 0x73, 0xcf, 0x25, 0xa3, 0x12,
|
||||
0xd4, 0x0e, 0x54, 0xbc, 0x03, 0x55, 0x0a, 0xcc, 0xfd, 0x37, 0x2a, 0x14, 0x6a, 0xa4, 0x1d, 0x27,
|
||||
0xc3, 0x51, 0x8a, 0x98, 0x66, 0x10, 0xf3, 0x42, 0xc4, 0x3c, 0xcf, 0x51, 0x73, 0x2d, 0x30, 0x2f,
|
||||
0xed, 0xb5, 0xf0, 0xd8, 0x51, 0xa3, 0x92, 0xed, 0x26, 0x06, 0x59, 0xe8, 0x17, 0x0b, 0x27, 0x3f,
|
||||
0x01, 0x19, 0x3c, 0xd8, 0x98, 0x5b, 0x28, 0x4b, 0x9e, 0x02, 0x65, 0xa4, 0xe3, 0x1c, 0x16, 0x9c,
|
||||
0x04, 0xa7, 0xbd, 0x3b, 0x2f, 0xe9, 0x88, 0xf4, 0xa6, 0x5b, 0x91, 0xad, 0xaf, 0xb9, 0x06, 0xd6,
|
||||
0x32, 0xec, 0xcf, 0xa8, 0xe8, 0x5c, 0xe8, 0x19, 0x4a, 0x29, 0x34, 0xfb, 0x67, 0x69, 0x6d, 0xd0,
|
||||
0x21, 0x69, 0xcf, 0x85, 0xbe, 0xe7, 0x29, 0xfb, 0x6f, 0x90, 0x53, 0x74, 0x42, 0xfa, 0xd5, 0x49,
|
||||
0x01, 0x2c, 0x75, 0x15, 0x7b, 0x60, 0x68, 0xc3, 0x33, 0xc9, 0xe8, 0xdf, 0xd4, 0x76, 0xc9, 0xde,
|
||||
0xa0, 0x21, 0xe9, 0xce, 0x50, 0x16, 0x22, 0x03, 0xc5, 0x3a, 0x06, 0xd6, 0xba, 0x62, 0x8b, 0x8c,
|
||||
0xeb, 0x0d, 0x2a, 0xc9, 0xba, 0x96, 0x79, 0x7d, 0x91, 0xd4, 0x93, 0x2f, 0x41, 0xed, 0xc4, 0x0a,
|
||||
0xe8, 0xa2, 0x9e, 0x9c, 0x0e, 0x23, 0xdb, 0x5a, 0xe4, 0x5b, 0x8b, 0x6e, 0xaa, 0xd6, 0xc2, 0xa3,
|
||||
0xc8, 0xef, 0xa0, 0xd9, 0xda, 0xe4, 0xf0, 0xf5, 0xf3, 0xfb, 0xad, 0x35, 0xa0, 0x7d, 0xb3, 0x05,
|
||||
0x77, 0x69, 0x7a, 0xf5, 0xbe, 0x1f, 0x07, 0x1f, 0xfb, 0x71, 0xf0, 0xb5, 0x1f, 0x07, 0x8f, 0x67,
|
||||
0xa9, 0xd0, 0x4f, 0xdb, 0x24, 0x5a, 0xa1, 0x8c, 0xb9, 0x4a, 0xb1, 0x50, 0xf8, 0x6c, 0x0e, 0xe7,
|
||||
0xab, 0x75, 0xdc, 0x5c, 0x75, 0xd2, 0x36, 0x3f, 0xbe, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x19,
|
||||
0x01, 0x2c, 0x30, 0x03, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -3,11 +3,16 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
argocd "github.com/argoproj/argo-cd"
|
||||
"github.com/argoproj/argo-cd/errors"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
)
|
||||
|
||||
@@ -49,3 +54,25 @@ func AddKubectlFlagsToCmd(cmd *cobra.Command) clientcmd.ClientConfig {
|
||||
clientcmd.BindOverrideFlags(&overrides, cmd.PersistentFlags(), kflags)
|
||||
return clientcmd.NewInteractiveDeferredLoadingClientConfig(loadingRules, &overrides, os.Stdin)
|
||||
}
|
||||
|
||||
// PromptCredentials is a helper to prompt the user for a username and password
|
||||
func PromptCredentials(username, password string) (string, string) {
|
||||
for username == "" {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
fmt.Print("Username: ")
|
||||
usernameRaw, err := reader.ReadString('\n')
|
||||
errors.CheckError(err)
|
||||
username = strings.TrimSpace(usernameRaw)
|
||||
}
|
||||
for password == "" {
|
||||
fmt.Print("Password: ")
|
||||
passwordRaw, err := terminal.ReadPassword(syscall.Stdin)
|
||||
errors.CheckError(err)
|
||||
password = string(passwordRaw)
|
||||
if password == "" {
|
||||
fmt.Print("\n")
|
||||
}
|
||||
}
|
||||
fmt.Print("\n")
|
||||
return username, password
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ func Diff(left, right *unstructured.Unstructured) *DiffResult {
|
||||
leftObj = left.Object
|
||||
}
|
||||
if right != nil {
|
||||
rightObj = removeMapFields(leftObj, right.Object)
|
||||
rightObj = RemoveMapFields(leftObj, right.Object)
|
||||
}
|
||||
gjDiff := gojsondiff.New().CompareObjects(leftObj, rightObj)
|
||||
dr := DiffResult{
|
||||
@@ -75,7 +75,7 @@ func (d *DiffResult) ASCIIFormat(left *unstructured.Unstructured, formatOpts for
|
||||
func removeFields(config, live interface{}) interface{} {
|
||||
switch c := config.(type) {
|
||||
case map[string]interface{}:
|
||||
return removeMapFields(c, live.(map[string]interface{}))
|
||||
return RemoveMapFields(c, live.(map[string]interface{}))
|
||||
case []interface{}:
|
||||
return removeListFields(c, live.([]interface{}))
|
||||
default:
|
||||
@@ -83,7 +83,7 @@ func removeFields(config, live interface{}) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
func removeMapFields(config, live map[string]interface{}) map[string]interface{} {
|
||||
func RemoveMapFields(config, live map[string]interface{}) map[string]interface{} {
|
||||
result := map[string]interface{}{}
|
||||
for k, v1 := range config {
|
||||
v2, ok := live[k]
|
||||
|
||||
@@ -3,8 +3,12 @@ package git
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -18,12 +22,61 @@ type Client interface {
|
||||
}
|
||||
|
||||
// NativeGitClient implements Client interface using git CLI
|
||||
type NativeGitClient struct {
|
||||
rootDirectoryPath string
|
||||
type NativeGitClient struct{}
|
||||
|
||||
// Init initializes a local git repository and sets the remote origin
|
||||
func (m *NativeGitClient) Init(repo string, repoPath string) error {
|
||||
log.Infof("Initializing %s to %s", repo, repoPath)
|
||||
err := os.MkdirAll(repoPath, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := runCmd(repoPath, "git", "init"); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := runCmd(repoPath, "git", "remote", "add", "origin", repo); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetCredentials sets a local credentials file to connect to a remote git repository
|
||||
func (m *NativeGitClient) SetCredentials(repo string, username string, password string, sshPrivateKey string, repoPath string) error {
|
||||
if password != "" {
|
||||
gitCredentialsFile := path.Join(repoPath, ".git", "credentials")
|
||||
repoURL, err := url.ParseRequestURI(repo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
repoURL.User = url.UserPassword(username, password)
|
||||
cmdURL := repoURL.String()
|
||||
err = ioutil.WriteFile(gitCredentialsFile, []byte(cmdURL), 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set git credentials: %v", err)
|
||||
}
|
||||
_, err = runCmd(repoPath, "git", "config", "--local", "credential.helper", fmt.Sprintf("store --file=%s", gitCredentialsFile))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if sshPrivateKey != "" {
|
||||
sshPrivateKeyFile := path.Join(repoPath, ".git", "ssh-private-key")
|
||||
err := ioutil.WriteFile(sshPrivateKeyFile, []byte(sshPrivateKey), 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set git credentials: %v", err)
|
||||
}
|
||||
sshCmd := fmt.Sprintf("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i %s", sshPrivateKeyFile)
|
||||
_, err = runCmd(repoPath, "git", "config", "--local", "core.sshCommand", sshCmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CloneOrFetch either clone or fetch repository into specified directory path.
|
||||
func (m *NativeGitClient) CloneOrFetch(repo string, username string, password string, sshPrivateKey string, repoPath string) error {
|
||||
log.Debugf("Cloning/Fetching repo %s at %s", repo, repoPath)
|
||||
var needClone bool
|
||||
if _, err := os.Stat(repoPath); os.IsNotExist(err) {
|
||||
needClone = true
|
||||
@@ -33,91 +86,104 @@ func (m *NativeGitClient) CloneOrFetch(repo string, username string, password st
|
||||
_, err = cmd.Output()
|
||||
needClone = err != nil
|
||||
}
|
||||
|
||||
repoURL, env, err := GetGitCommandEnvAndURL(repo, username, password, sshPrivateKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if needClone {
|
||||
_, err := exec.Command("rm", "-rf", repoPath).Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to clean repo cache at %s: %v", repoPath, err)
|
||||
}
|
||||
|
||||
log.Infof("Cloning %s to %s", repo, repoPath)
|
||||
cmd := exec.Command("git", "clone", repoURL, repoPath)
|
||||
cmd.Env = env
|
||||
_, err = cmd.Output()
|
||||
err = m.Init(repo, repoPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to clone repository %s: %v", repo, err)
|
||||
}
|
||||
} else {
|
||||
log.Infof("Fetching %s", repo)
|
||||
// Fetch remote changes and delete all local branches
|
||||
cmd := exec.Command("sh", "-c", "git fetch --all && git checkout --detach HEAD")
|
||||
cmd.Env = env
|
||||
cmd.Dir = repoPath
|
||||
_, err := cmd.Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to fetch repo %s: %v", repoPath, err)
|
||||
}
|
||||
}
|
||||
|
||||
cmd = exec.Command("sh", "-c", "for i in $(git branch --merged | grep -v \\*); do git branch -D $i; done")
|
||||
cmd.Dir = repoPath
|
||||
_, err = cmd.Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to delete local branches for %s: %v", repoPath, err)
|
||||
err := m.SetCredentials(repo, username, password, sshPrivateKey, repoPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Fetch remote changes
|
||||
if _, err = runCmd(repoPath, "git", "fetch", "origin"); err != nil {
|
||||
return err
|
||||
}
|
||||
// git fetch does not update the HEAD reference. The following command will update the local
|
||||
// knowledge of what remote considers the “default branch”
|
||||
// See: https://stackoverflow.com/questions/8839958/how-does-origin-head-get-set
|
||||
if _, err := runCmd(repoPath, "git", "remote", "set-head", "origin", "-a"); err != nil {
|
||||
return err
|
||||
}
|
||||
// Delete all local branches (we must first detach so we are not checked out a branch we are about to delete)
|
||||
if _, err = runCmd(repoPath, "git", "checkout", "--detach", "origin/HEAD"); err != nil {
|
||||
return err
|
||||
}
|
||||
branchesOut, err := runCmd(repoPath, "git", "for-each-ref", "--format=%(refname:short)", "refs/heads/")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
branchesOut = strings.TrimSpace(branchesOut)
|
||||
if branchesOut != "" {
|
||||
branches := strings.Split(branchesOut, "\n")
|
||||
args := []string{"branch", "-D"}
|
||||
args = append(args, branches...)
|
||||
if _, err = runCmd(repoPath, "git", args...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Reset resets local changes
|
||||
// Reset resets local changes in a repository
|
||||
func (m *NativeGitClient) Reset(repoPath string) error {
|
||||
cmd := exec.Command("sh", "-c", "git reset --hard HEAD && git clean -f")
|
||||
cmd.Dir = repoPath
|
||||
_, err := cmd.Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to reset repository %s: %v", repoPath, err)
|
||||
if _, err := runCmd(repoPath, "git", "reset", "--hard", "origin/HEAD"); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := runCmd(repoPath, "git", "clean", "-f"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Checkout checkout specified git sha
|
||||
func (m *NativeGitClient) Checkout(repoPath string, sha string) (string, error) {
|
||||
if sha == "" {
|
||||
sha = "origin/HEAD"
|
||||
func (m *NativeGitClient) Checkout(repoPath string, revision string) (string, error) {
|
||||
if revision == "" || revision == "HEAD" {
|
||||
revision = "origin/HEAD"
|
||||
}
|
||||
checkoutCmd := exec.Command("git", "checkout", sha)
|
||||
checkoutCmd.Dir = repoPath
|
||||
_, err := checkoutCmd.Output()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("unable to checkout revision %s: %v", sha, err)
|
||||
if _, err := runCmd(repoPath, "git", "checkout", revision); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return m.CommitSHA(repoPath)
|
||||
}
|
||||
|
||||
// CommitSHA returns current commit sha from `git rev-parse HEAD`
|
||||
func (m *NativeGitClient) CommitSHA(repoPath string) (string, error) {
|
||||
revisionCmd := exec.Command("git", "rev-parse", "HEAD")
|
||||
revisionCmd.Dir = repoPath
|
||||
output, err := revisionCmd.Output()
|
||||
out, err := runCmd(repoPath, "git", "rev-parse", "HEAD")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(output), nil
|
||||
return strings.TrimSpace(out), nil
|
||||
}
|
||||
|
||||
// NewNativeGitClient creates new instance of NativeGitClient
|
||||
func NewNativeGitClient() (Client, error) {
|
||||
rootDirPath, err := ioutil.TempDir("", "argo-git")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &NativeGitClient{
|
||||
rootDirectoryPath: rootDirPath,
|
||||
}, nil
|
||||
return &NativeGitClient{}, nil
|
||||
}
|
||||
|
||||
// runCmd is a convenience function to run a command in a given directory and return its output
|
||||
func runCmd(cwd string, command string, args ...string) (string, error) {
|
||||
cmd := exec.Command(command, args...)
|
||||
log.Debug(strings.Join(cmd.Args, " "))
|
||||
cmd.Dir = cwd
|
||||
out, err := cmd.Output()
|
||||
if len(out) > 0 {
|
||||
log.Debug(string(out))
|
||||
}
|
||||
if err != nil {
|
||||
exErr, ok := err.(*exec.ExitError)
|
||||
if ok {
|
||||
errOutput := strings.Split(string(exErr.Stderr), "\n")[0]
|
||||
log.Debug(errOutput)
|
||||
return string(out), fmt.Errorf("'%s' failed: %v", strings.Join(cmd.Args, " "), errOutput)
|
||||
}
|
||||
return string(out), fmt.Errorf("'%s' failed: %v", strings.Join(cmd.Args, " "), err)
|
||||
}
|
||||
return string(out), nil
|
||||
}
|
||||
|
||||
@@ -8,13 +8,20 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"encoding/json"
|
||||
|
||||
"github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
|
||||
"github.com/argoproj/argo-cd/util/cli"
|
||||
"github.com/argoproj/argo-cd/util/diff"
|
||||
"github.com/ghodss/yaml"
|
||||
"github.com/ksonnet/ksonnet/metadata"
|
||||
"github.com/ksonnet/ksonnet/pkg/app"
|
||||
"github.com/ksonnet/ksonnet/pkg/component"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/afero"
|
||||
"k8s.io/api/apps/v1beta1"
|
||||
"k8s.io/api/apps/v1beta2"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
v1ExtBeta1 "k8s.io/api/extensions/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
)
|
||||
|
||||
@@ -44,28 +51,37 @@ type KsonnetApp interface {
|
||||
SetComponentParams(environment string, component string, param string, value string) error
|
||||
}
|
||||
|
||||
// KsonnetVersion returns the version of ksonnet used when running ksonnet commands
|
||||
func KsonnetVersion() (string, error) {
|
||||
cmd := exec.Command("ks", "version")
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("unable to determine ksonnet version: %v", err)
|
||||
}
|
||||
ksonnetVersionStr := strings.Split(string(out), "\n")[0]
|
||||
parts := strings.SplitN(ksonnetVersionStr, ":", 2)
|
||||
if len(parts) != 2 {
|
||||
return "", fmt.Errorf("unexpected version string format: %s", ksonnetVersionStr)
|
||||
}
|
||||
return strings.TrimSpace(parts[1]), nil
|
||||
}
|
||||
|
||||
type ksonnetApp struct {
|
||||
manager metadata.Manager
|
||||
app app.App
|
||||
spec app.Spec
|
||||
app app.App
|
||||
spec app.Spec
|
||||
}
|
||||
|
||||
// NewKsonnetApp tries to create a new wrapper to run commands on the `ks` command-line tool.
|
||||
func NewKsonnetApp(path string) (KsonnetApp, error) {
|
||||
ksApp := ksonnetApp{}
|
||||
mgr, err := metadata.Find(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ksApp.manager = mgr
|
||||
a, err := ksApp.manager.App()
|
||||
a, err := app.Load(afero.NewOsFs(), path, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ksApp.app = a
|
||||
|
||||
var spec app.Spec
|
||||
err = cli.UnmarshalLocalFile(filepath.Join(ksApp.manager.Root(), "app.yaml"), &spec)
|
||||
err = cli.UnmarshalLocalFile(filepath.Join(a.Root(), "app.yaml"), &spec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -93,7 +109,7 @@ func (k *ksonnetApp) ksCmd(args ...string) (string, error) {
|
||||
}
|
||||
|
||||
func (k *ksonnetApp) Root() string {
|
||||
return k.manager.Root()
|
||||
return k.app.Root()
|
||||
}
|
||||
|
||||
// App is the Ksonnet application
|
||||
@@ -123,12 +139,58 @@ func (k *ksonnetApp) Show(environment string) ([]*unstructured.Unstructured, err
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to unmarshal manifest from `ks show`")
|
||||
}
|
||||
err = remarshal(&obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objs = append(objs, &obj)
|
||||
}
|
||||
// TODO(jessesuen): we need to sort objects based on their dependency order of creation
|
||||
return objs, nil
|
||||
}
|
||||
|
||||
// remarshal checks resource kind and version and re-marshal using corresponding struct custom marshaller. This ensures that expected resource state is formatter same as actual
|
||||
// resource state in kubernetes and allows to find differences between actual and target states more accurate.
|
||||
func remarshal(obj *unstructured.Unstructured) error {
|
||||
var newObj interface{}
|
||||
switch obj.GetAPIVersion() + ":" + obj.GetKind() {
|
||||
case "apps/v1beta1:Deployment":
|
||||
newObj = &v1beta1.Deployment{}
|
||||
case "apps/v1beta2:Deployment":
|
||||
newObj = &v1beta2.Deployment{}
|
||||
case "extensions/v1beta1":
|
||||
newObj = &v1ExtBeta1.Deployment{}
|
||||
case "apps/v1beta1:StatefulSet":
|
||||
newObj = &v1beta1.StatefulSet{}
|
||||
case "apps/v1beta2:StatefulSet":
|
||||
newObj = &v1beta2.StatefulSet{}
|
||||
case "v1:Service":
|
||||
newObj = &corev1.Service{}
|
||||
}
|
||||
if newObj != nil {
|
||||
oldObj := obj.Object
|
||||
data, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = json.Unmarshal(data, newObj)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
data, err = json.Marshal(newObj)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = json.Unmarshal(data, obj)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// remove all default values specified by custom formatter
|
||||
obj.Object = diff.RemoveMapFields(oldObj, obj.Object)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListEnvParams returns list of environment parameters
|
||||
func (k *ksonnetApp) ListEnvParams(environment string) ([]*v1alpha1.ComponentParameter, error) {
|
||||
mod, err := component.DefaultManager.Module(k.app, "")
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Package kube provides helper utilities common for kubernetes
|
||||
|
||||
package kube
|
||||
|
||||
import (
|
||||
@@ -8,7 +7,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sync"
|
||||
@@ -26,6 +24,8 @@ import (
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -34,6 +34,11 @@ const (
|
||||
deleteCollectionVerb = "deletecollection"
|
||||
)
|
||||
|
||||
const (
|
||||
ServiceKind = "Service"
|
||||
EndpointsKind = "Endpoints"
|
||||
)
|
||||
|
||||
var (
|
||||
// location to use for generating temporary files, such as the ca.crt needed by kubectl
|
||||
kubectlTempDir string
|
||||
@@ -426,19 +431,55 @@ func ListAllResources(config *rest.Config, apiResources []metav1.APIResource, na
|
||||
return resources, nil
|
||||
}
|
||||
|
||||
// deleteFile is best effort deletion of a file
|
||||
func deleteFile(path string) {
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
_ = os.Remove(path)
|
||||
}
|
||||
|
||||
// DeleteResource deletes resource
|
||||
func DeleteResource(config *rest.Config, obj *unstructured.Unstructured, namespace string) error {
|
||||
dynClientPool := dynamic.NewDynamicClientPool(config)
|
||||
disco, err := discovery.NewDiscoveryClientForConfig(config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
gvk := obj.GroupVersionKind()
|
||||
dclient, err := dynClientPool.ClientForGroupVersionKind(gvk)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
apiResource, err := ServerResourceForGroupVersionKind(disco, gvk)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reIf := dclient.Resource(apiResource, namespace)
|
||||
propagationPolicy := metav1.DeletePropagationForeground
|
||||
return reIf.Delete(obj.GetName(), &metav1.DeleteOptions{PropagationPolicy: &propagationPolicy})
|
||||
}
|
||||
|
||||
// ApplyResource performs an apply of a unstructured resource
|
||||
func ApplyResource(config *rest.Config, obj *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error) {
|
||||
log.Infof("Applying resource %s/%s in cluster: %s, namespace: %s", obj.GetKind(), obj.GetName(), config.Host, namespace)
|
||||
cmdArgs, err := formulateKubectlOptions(config)
|
||||
f, err := ioutil.TempFile(kubectlTempDir, "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("Failed to generate temp file for kubeconfig: %v", err)
|
||||
}
|
||||
_ = f.Close()
|
||||
err = WriteKubeConfig(config, namespace, f.Name())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to write kubeconfig: %v", err)
|
||||
}
|
||||
defer deleteFile(f.Name())
|
||||
|
||||
manifestBytes, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cmdArgs = append(cmdArgs, "-n", namespace, "apply", "-o", "json", "-f", "-")
|
||||
cmd := exec.Command("kubectl", cmdArgs...)
|
||||
cmd := exec.Command("kubectl", "--kubeconfig", f.Name(), "-n", namespace, "apply", "-o", "json", "-f", "-")
|
||||
log.Info(cmd.Args)
|
||||
cmd.Stdin = bytes.NewReader(manifestBytes)
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
@@ -453,119 +494,57 @@ func ApplyResource(config *rest.Config, obj *unstructured.Unstructured, namespac
|
||||
return &liveObj, nil
|
||||
}
|
||||
|
||||
func writeTempFile(prefix string, data []byte) (string, error) {
|
||||
f, err := ioutil.TempFile(kubectlTempDir, prefix)
|
||||
if err != nil {
|
||||
return "", err
|
||||
// WriteKubeConfig takes a rest.Config and writes it as a kubeconfig at the specified path
|
||||
func WriteKubeConfig(restConfig *rest.Config, namespace, filename string) error {
|
||||
var kubeConfig = clientcmdapi.Config{
|
||||
CurrentContext: restConfig.Host,
|
||||
Contexts: map[string]*clientcmdapi.Context{
|
||||
restConfig.Host: {
|
||||
Cluster: restConfig.Host,
|
||||
AuthInfo: restConfig.Host,
|
||||
Namespace: namespace,
|
||||
},
|
||||
},
|
||||
Clusters: map[string]*clientcmdapi.Cluster{
|
||||
restConfig.Host: {
|
||||
Server: restConfig.Host,
|
||||
},
|
||||
},
|
||||
AuthInfos: map[string]*clientcmdapi.AuthInfo{
|
||||
restConfig.Host: {},
|
||||
},
|
||||
}
|
||||
_, err = f.Write(data)
|
||||
if err != nil {
|
||||
return "", err
|
||||
// Set Cluster info
|
||||
if restConfig.TLSClientConfig.Insecure {
|
||||
kubeConfig.Clusters[restConfig.Host].InsecureSkipTLSVerify = true
|
||||
}
|
||||
err = f.Close()
|
||||
if err != nil {
|
||||
return "", err
|
||||
if restConfig.TLSClientConfig.CAFile != "" {
|
||||
kubeConfig.Clusters[restConfig.Host].CertificateAuthority = restConfig.TLSClientConfig.CAFile
|
||||
}
|
||||
return f.Name(), nil
|
||||
}
|
||||
|
||||
// formulateKubectlOptions returns a list of equivalent kubectl flags given a k8s rest.Config
|
||||
func formulateKubectlOptions(config *rest.Config) ([]string, error) {
|
||||
opts := []string{
|
||||
"--server", config.Host,
|
||||
}
|
||||
if config.TLSClientConfig.Insecure {
|
||||
opts = append(opts, "--insecure-skip-tls-verify=true")
|
||||
}
|
||||
if config.TLSClientConfig.CAFile != "" {
|
||||
opts = append(opts, "--certificate-authority", config.TLSClientConfig.CAFile)
|
||||
} else if len(config.TLSClientConfig.CAData) > 0 {
|
||||
return nil, fmt.Errorf("Cannot generate kubectl options with cert-data")
|
||||
}
|
||||
if config.TLSClientConfig.CertFile != "" {
|
||||
opts = append(opts, "--client-certificate", config.TLSClientConfig.CertFile)
|
||||
} else if len(config.TLSClientConfig.CertData) > 0 {
|
||||
return nil, fmt.Errorf("Cannot generate kubectl options with cert-data")
|
||||
}
|
||||
if config.TLSClientConfig.KeyFile != "" {
|
||||
opts = append(opts, "--client-key", config.TLSClientConfig.KeyFile)
|
||||
} else if len(config.TLSClientConfig.KeyData) > 0 {
|
||||
return nil, fmt.Errorf("Cannot generate kubectl options with cert-data")
|
||||
}
|
||||
if config.Username != "" {
|
||||
opts = append(opts, "--username", config.Username)
|
||||
}
|
||||
if config.Password != "" {
|
||||
opts = append(opts, "--password", config.Password)
|
||||
}
|
||||
if config.BearerToken != "" {
|
||||
opts = append(opts, "--token", config.BearerToken)
|
||||
}
|
||||
return opts, nil
|
||||
}
|
||||
|
||||
// GenerateTLSFiles examines the TLS settings of a rest.Config to see if it uses any TLS data
|
||||
// (i.e. CAData, CertData, KeyData). It then creates them as temporary local files (which can
|
||||
// later be used as arguments to a kubectl command), and updates the config with paths.
|
||||
func GenerateTLSFiles(config *rest.Config) error {
|
||||
var host string
|
||||
if serverURL, err := url.Parse(config.Host); err != nil {
|
||||
host = serverURL.Host
|
||||
}
|
||||
if len(config.TLSClientConfig.CAData) > 0 && config.TLSClientConfig.CAFile == "" {
|
||||
fileName, err := writeTempFile(fmt.Sprintf("%s-ca.crt-", host), config.TLSClientConfig.CAData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.TLSClientConfig.CAFile = fileName
|
||||
}
|
||||
if len(config.TLSClientConfig.CertData) > 0 && config.TLSClientConfig.CertFile == "" {
|
||||
fileName, err := writeTempFile(fmt.Sprintf("%s-client.crt-", host), config.TLSClientConfig.CertData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.TLSClientConfig.CertFile = fileName
|
||||
}
|
||||
if len(config.TLSClientConfig.KeyData) > 0 && config.TLSClientConfig.KeyFile == "" {
|
||||
fileName, err := writeTempFile(fmt.Sprintf("%s-client.key-", host), config.TLSClientConfig.KeyData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.TLSClientConfig.KeyFile = fileName
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deleteFile(path string) error {
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return os.Remove(path)
|
||||
}
|
||||
|
||||
// DeleteTLSFiles deletes any local TLS related files referenced by a rest Config.
|
||||
func DeleteTLSFiles(config *rest.Config) error {
|
||||
var err error
|
||||
if config.TLSClientConfig.CAFile != "" {
|
||||
err = deleteFile(config.TLSClientConfig.CAFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.TLSClientConfig.CAFile = ""
|
||||
}
|
||||
if config.TLSClientConfig.CertFile != "" {
|
||||
err = deleteFile(config.TLSClientConfig.CertFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.TLSClientConfig.CertFile = ""
|
||||
}
|
||||
if config.TLSClientConfig.KeyFile != "" {
|
||||
err = deleteFile(config.TLSClientConfig.KeyFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.TLSClientConfig.KeyFile = ""
|
||||
}
|
||||
return nil
|
||||
// Set AuthInfo
|
||||
if len(restConfig.TLSClientConfig.CAData) > 0 {
|
||||
kubeConfig.Clusters[restConfig.Host].CertificateAuthorityData = restConfig.TLSClientConfig.CAData
|
||||
}
|
||||
if restConfig.TLSClientConfig.CertFile != "" {
|
||||
kubeConfig.AuthInfos[restConfig.Host].ClientCertificate = restConfig.TLSClientConfig.CertFile
|
||||
}
|
||||
if len(restConfig.TLSClientConfig.CertData) > 0 {
|
||||
kubeConfig.AuthInfos[restConfig.Host].ClientCertificateData = restConfig.TLSClientConfig.CertData
|
||||
}
|
||||
if restConfig.TLSClientConfig.KeyFile != "" {
|
||||
kubeConfig.AuthInfos[restConfig.Host].ClientKey = restConfig.TLSClientConfig.KeyFile
|
||||
}
|
||||
if len(restConfig.TLSClientConfig.KeyData) > 0 {
|
||||
kubeConfig.AuthInfos[restConfig.Host].ClientKeyData = restConfig.TLSClientConfig.KeyData
|
||||
}
|
||||
if restConfig.Username != "" {
|
||||
kubeConfig.AuthInfos[restConfig.Host].Username = restConfig.Username
|
||||
}
|
||||
if restConfig.Password != "" {
|
||||
kubeConfig.AuthInfos[restConfig.Host].Password = restConfig.Password
|
||||
}
|
||||
if restConfig.BearerToken != "" {
|
||||
kubeConfig.AuthInfos[restConfig.Host].Token = restConfig.BearerToken
|
||||
}
|
||||
return clientcmd.WriteToFile(kubeConfig, filename)
|
||||
}
|
||||
|
||||
@@ -76,8 +76,12 @@ func ValidateLocalConfig(config LocalConfig) error {
|
||||
}
|
||||
|
||||
// WriteLocalConfig writes a new local configuration file.
|
||||
func WriteLocalConfig(config LocalConfig, path string) error {
|
||||
return cli.MarshalLocalYAMLFile(path, config)
|
||||
func WriteLocalConfig(config LocalConfig, configPath string) error {
|
||||
err := os.MkdirAll(path.Dir(configPath), os.ModePerm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cli.MarshalLocalYAMLFile(configPath, config)
|
||||
}
|
||||
|
||||
// ResolveContext resolves the specified context. If unspecified, resolves the current context
|
||||
@@ -153,8 +157,8 @@ func (l *LocalConfig) UpsertContext(context ContextRef) {
|
||||
l.Contexts = append(l.Contexts, context)
|
||||
}
|
||||
|
||||
// LocalConfigDir returns the local configuration path for settings such as cached authentication tokens.
|
||||
func localConfigDir() (string, error) {
|
||||
// DefaultConfigDir returns the local configuration path for settings such as cached authentication tokens.
|
||||
func DefaultConfigDir() (string, error) {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -164,7 +168,7 @@ func localConfigDir() (string, error) {
|
||||
|
||||
// DefaultLocalConfigPath returns the local configuration path for settings such as cached authentication tokens.
|
||||
func DefaultLocalConfigPath() (string, error) {
|
||||
dir, err := localConfigDir()
|
||||
dir, err := DefaultConfigDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user