From 4c1b7504edee123def5434b8f7881cd98c2fe0de Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Thu, 8 Nov 2018 09:21:44 -0800 Subject: [PATCH] Issue #621 - Remove resources state from application CRD --- Procfile | 2 +- cmd/argocd-application-controller/main.go | 31 +- cmd/argocd-server/commands/root.go | 44 +- cmd/argocd/commands/app.go | 62 +- controller/appcontroller.go | 167 +++- controller/clientset.go | 36 + controller/services/application.pb.go | 758 ++++++++++++++++ controller/services/application.proto | 26 + controller/state.go | 41 +- controller/sync.go | 15 +- controller/sync_test.go | 93 +- hack/generate-proto.sh | 3 +- .../application-controller-deployment.yaml | 2 +- .../base/application-controller-service.yaml | 10 + manifests/base/kustomization.yaml | 7 +- manifests/install.yaml | 21 +- manifests/namespace-install.yaml | 21 +- pkg/apis/application/v1alpha1/generated.pb.go | 854 ++++++++++++------ pkg/apis/application/v1alpha1/generated.proto | 19 +- pkg/apis/application/v1alpha1/types.go | 48 +- .../v1alpha1/zz_generated.deepcopy.go | 23 +- reposerver/repository/repository_test.go | 2 +- server/application/application.go | 157 ++-- server/application/application.pb.go | 261 +++--- server/application/application.pb.gw.go | 69 ++ server/application/application.proto | 5 + server/application/application_test.go | 4 +- server/server.go | 22 +- server/swagger.json | 76 +- test/e2e/app_management_test.go | 9 - test/e2e/fixture.go | 74 +- util/argo/argo.go | 14 +- util/argo/argo_test.go | 6 +- 33 files changed, 2287 insertions(+), 695 deletions(-) create mode 100644 controller/clientset.go create mode 100644 controller/services/application.pb.go create mode 100644 controller/services/application.proto create mode 100644 manifests/base/application-controller-service.yaml diff --git a/Procfile b/Procfile index d841dce6e4b37..389ded6b999e9 100644 --- a/Procfile +++ b/Procfile @@ -1,4 +1,4 @@ controller: go run ./cmd/argocd-application-controller/main.go -api-server: go run ./cmd/argocd-server/main.go --insecure --disable-auth --dex-server http://localhost:5556 --repo-server localhost:8081 +api-server: go run ./cmd/argocd-server/main.go --insecure --disable-auth --dex-server http://localhost:5556 --repo-server localhost:8081 --app-controller-server localhost:8083 repo-server: go run ./cmd/argocd-repo-server/main.go --loglevel debug dex: sh -c "go run ./cmd/argocd-util/main.go gendexcfg -o `pwd`/dist/dex.yaml && docker run --rm -p 5556:5556 -v `pwd`/dist/dex.yaml:/dex.yaml quay.io/dexidp/dex:v2.12.0 serve /dex.yaml" diff --git a/cmd/argocd-application-controller/main.go b/cmd/argocd-application-controller/main.go index fcfa21ada98ee..75abdbce050d3 100644 --- a/cmd/argocd-application-controller/main.go +++ b/cmd/argocd-application-controller/main.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "net" "os" "time" @@ -23,6 +24,7 @@ import ( "github.com/argoproj/argo-cd/reposerver" "github.com/argoproj/argo-cd/util/cli" "github.com/argoproj/argo-cd/util/stats" + "github.com/argoproj/argo-cd/util/tls" ) const ( @@ -34,13 +36,14 @@ const ( func newCommand() *cobra.Command { var ( - clientConfig clientcmd.ClientConfig - appResyncPeriod int64 - repoServerAddress string - statusProcessors int - operationProcessors int - logLevel string - glogLevel int + clientConfig clientcmd.ClientConfig + appResyncPeriod int64 + repoServerAddress string + statusProcessors int + operationProcessors int + logLevel string + glogLevel int + tlsConfigCustomizerSrc func() (tls.ConfigCustomizer, error) ) var command = cobra.Command{ Use: cliName, @@ -76,6 +79,19 @@ func newCommand() *cobra.Command { stats.RegisterHeapDumper("memprofile") go appController.Run(ctx, statusProcessors, operationProcessors) + go func() { + tlsConfigCustomizer, err := tlsConfigCustomizerSrc() + errors.CheckError(err) + server, err := appController.CreateGRPC(tlsConfigCustomizer) + errors.CheckError(err) + + listener, err := net.Listen("tcp", fmt.Sprintf(":%d", 8083)) + errors.CheckError(err) + log.Infof("application-controller %s serving on %s", argocd.GetVersion(), listener.Addr()) + + err = server.Serve(listener) + errors.CheckError(err) + }() // Wait forever select {} }, @@ -88,6 +104,7 @@ func newCommand() *cobra.Command { command.Flags().IntVar(&operationProcessors, "operation-processors", 1, "Number of application operation processors") command.Flags().StringVar(&logLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error") command.Flags().IntVar(&glogLevel, "gloglevel", 0, "Set the glog logging level") + tlsConfigCustomizerSrc = tls.AddTLSFlagsToCmd(&command) return &command } diff --git a/cmd/argocd-server/commands/root.go b/cmd/argocd-server/commands/root.go index f66b9b768619f..d343b9ba21074 100644 --- a/cmd/argocd-server/commands/root.go +++ b/cmd/argocd-server/commands/root.go @@ -8,6 +8,7 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" + "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" @@ -23,20 +24,24 @@ const ( // DefaultRepoServerAddr is the gRPC address of the Argo CD repo server DefaultRepoServerAddr = "argocd-repo-server:8081" + + // DefaultAppControllerServerAddr is the gRPC address of the Argo CD app controller server + DefaultAppControllerServerAddr = "application-controller:8083" ) // NewCommand returns a new instance of an argocd command func NewCommand() *cobra.Command { var ( - insecure bool - logLevel string - glogLevel int - clientConfig clientcmd.ClientConfig - staticAssetsDir string - repoServerAddress string - dexServerAddress string - disableAuth bool - tlsConfigCustomizerSrc func() (tls.ConfigCustomizer, error) + insecure bool + logLevel string + glogLevel int + clientConfig clientcmd.ClientConfig + staticAssetsDir string + repoServerAddress string + appControllerServerAddress string + dexServerAddress string + disableAuth bool + tlsConfigCustomizerSrc func() (tls.ConfigCustomizer, error) ) var command = &cobra.Command{ Use: cliName, @@ -58,17 +63,19 @@ func NewCommand() *cobra.Command { kubeclientset := kubernetes.NewForConfigOrDie(config) appclientset := appclientset.NewForConfigOrDie(config) repoclientset := reposerver.NewRepositoryServerClientset(repoServerAddress) + appcontrollerclientset := controller.NewAppControllerClientset(appControllerServerAddress) argoCDOpts := server.ArgoCDServerOpts{ - Insecure: insecure, - Namespace: namespace, - StaticAssetsDir: staticAssetsDir, - KubeClientset: kubeclientset, - AppClientset: appclientset, - RepoClientset: repoclientset, - DexServerAddr: dexServerAddress, - DisableAuth: disableAuth, - TLSConfigCustomizer: tlsConfigCustomizer, + Insecure: insecure, + Namespace: namespace, + StaticAssetsDir: staticAssetsDir, + KubeClientset: kubeclientset, + AppClientset: appclientset, + RepoClientset: repoclientset, + DexServerAddr: dexServerAddress, + DisableAuth: disableAuth, + TLSConfigCustomizer: tlsConfigCustomizer, + AppControllerClientset: appcontrollerclientset, } stats.RegisterStackDumper() @@ -91,6 +98,7 @@ func NewCommand() *cobra.Command { command.Flags().StringVar(&logLevel, "loglevel", "info", "Set the logging level. One of: debug|info|warn|error") command.Flags().IntVar(&glogLevel, "gloglevel", 0, "Set the glog logging level") command.Flags().StringVar(&repoServerAddress, "repo-server", DefaultRepoServerAddr, "Repo server address") + command.Flags().StringVar(&appControllerServerAddress, "app-controller-server", DefaultAppControllerServerAddr, "App controller server address") command.Flags().StringVar(&dexServerAddress, "dex-server", DefaultDexServerAddr, "Dex server address") command.Flags().BoolVar(&disableAuth, "disable-auth", false, "Disable client authentication") command.AddCommand(cli.NewVersionCmd(cliName)) diff --git a/cmd/argocd/commands/app.go b/cmd/argocd/commands/app.go index d460c32afec63..71f6626ba71a0 100644 --- a/cmd/argocd/commands/app.go +++ b/cmd/argocd/commands/app.go @@ -25,6 +25,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "github.com/argoproj/argo-cd/common" + "github.com/argoproj/argo-cd/controller/services" "github.com/argoproj/argo-cd/errors" argocdclient "github.com/argoproj/argo-cd/pkg/apiclient" argoappv1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" @@ -505,6 +506,32 @@ func NewApplicationUnsetCommand(clientOpts *argocdclient.ClientOptions) *cobra.C return command } +// targetObjects deserializes the list of target states into unstructured objects +func targetObjects(resources []*argoappv1.ResourceState) ([]*unstructured.Unstructured, error) { + objs := make([]*unstructured.Unstructured, len(resources)) + for i, resState := range resources { + obj, err := resState.TargetObject() + if err != nil { + return nil, err + } + objs[i] = obj + } + return objs, nil +} + +// liveObjects deserializes the list of live states into unstructured objects +func liveObjects(resources []*argoappv1.ResourceState) ([]*unstructured.Unstructured, error) { + objs := make([]*unstructured.Unstructured, len(resources)) + for i, resState := range resources { + obj, err := resState.LiveObject() + if err != nil { + return nil, err + } + objs[i] = obj + } + return objs, nil +} + // NewApplicationDiffCommand returns a new instance of an `argocd app diff` command func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command { var ( @@ -525,7 +552,9 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co appName := args[0] app, err := appIf.Get(context.Background(), &application.ApplicationQuery{Name: &appName, Refresh: refresh}) errors.CheckError(err) - liveObjs, err := app.Status.ComparisonResult.LiveObjects() + resources, err := appIf.Resources(context.Background(), &services.ResourcesQuery{ApplicationName: &appName}) + errors.CheckError(err) + liveObjs, err := liveObjects(resources.Items) errors.CheckError(err) var compareObjs []*unstructured.Unstructured @@ -545,7 +574,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co if env != "" { log.Fatal("--env option invalid when performing git diff") } - compareObjs, err = app.Status.ComparisonResult.TargetObjects() + compareObjs, err = targetObjects(resources.Items) errors.CheckError(err) } @@ -811,17 +840,11 @@ func printAppResources(w io.Writer, app *argoappv1.Application, showOperation bo fmt.Fprintf(w, "KIND\tNAME\tSTATUS\tHEALTH\n") } for _, res := range app.Status.ComparisonResult.Resources { - obj, err := argoappv1.UnmarshalToUnstructured(res.TargetState) - errors.CheckError(err) - if obj == nil { - obj, err = argoappv1.UnmarshalToUnstructured(res.LiveState) - errors.CheckError(err) - } if showOperation { - message := messages[fmt.Sprintf("%s/%s", obj.GetKind(), obj.GetName())] - fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s", obj.GetKind(), obj.GetName(), res.Status, res.Health.Status, "", message) + message := messages[fmt.Sprintf("%s/%s", res.Kind, res.Name)] + fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s", res.Kind, res.Name, res.Status, res.Health.Status, "", message) } else { - fmt.Fprintf(w, "%s\t%s\t%s\t%s", obj.GetKind(), obj.GetName(), res.Status, res.Health.Status) + fmt.Fprintf(w, "%s\t%s\t%s\t%s", res.Kind, res.Name, res.Status, res.Health.Status) } fmt.Fprint(w, "\n") } @@ -977,16 +1000,11 @@ func (rs *resourceState) Merge(newState *resourceState) bool { func calculateResourceStates(app *argoappv1.Application, syncResources []argoappv1.SyncOperationResource) map[string]*resourceState { resStates := make(map[string]*resourceState) for _, res := range app.Status.ComparisonResult.Resources { - obj, err := argoappv1.UnmarshalToUnstructured(res.TargetState) - errors.CheckError(err) - if obj == nil { - obj, err = argoappv1.UnmarshalToUnstructured(res.LiveState) - errors.CheckError(err) - } - if syncResources != nil && !argo.ContainsSyncResource(obj, syncResources) { + + if len(syncResources) > 0 && !argo.ContainsSyncResource(res.Name, res.GroupVersionKind(), syncResources) { continue } - newState := newResourceState(obj.GetKind(), obj.GetName(), string(res.Status), res.Health.Status, "", "") + newState := newResourceState(res.Kind, res.Name, string(res.Status), res.Health.Status, "", "") key := newState.Key() if prev, ok := resStates[key]; ok { prev.Merge(newState) @@ -1300,7 +1318,7 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie() defer util.Close(conn) ctx := context.Background() - app, err := appIf.Get(ctx, &application.ApplicationQuery{Name: &appName}) + resources, err := appIf.Resources(ctx, &services.ResourcesQuery{ApplicationName: &appName}) errors.CheckError(err) var unstructureds []*unstructured.Unstructured @@ -1319,12 +1337,12 @@ func NewApplicationManifestsCommand(clientOpts *argocdclient.ClientOptions) *cob unstructureds = append(unstructureds, obj) } } else { - targetObjs, err := app.Status.ComparisonResult.TargetObjects() + targetObjs, err := targetObjects(resources.Items) errors.CheckError(err) unstructureds = targetObjs } case "live": - liveObjs, err := app.Status.ComparisonResult.LiveObjects() + liveObjs, err := liveObjects(resources.Items) errors.CheckError(err) unstructureds = liveObjs default: diff --git a/controller/appcontroller.go b/controller/appcontroller.go index 0bfadec7e9d98..049461636b47e 100644 --- a/controller/appcontroller.go +++ b/controller/appcontroller.go @@ -2,6 +2,7 @@ package controller import ( "context" + "crypto/tls" "encoding/json" "fmt" "reflect" @@ -9,9 +10,16 @@ import ( "sync" "time" - settings_util "github.com/argoproj/argo-cd/util/settings" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/reflection" + "google.golang.org/grpc/status" + "github.com/grpc-ecosystem/go-grpc-middleware" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus" log "github.com/sirupsen/logrus" + "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,14 +35,19 @@ import ( "k8s.io/client-go/util/workqueue" "github.com/argoproj/argo-cd/common" + "github.com/argoproj/argo-cd/controller/services" appv1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" appclientset "github.com/argoproj/argo-cd/pkg/client/clientset/versioned" appinformers "github.com/argoproj/argo-cd/pkg/client/informers/externalversions" "github.com/argoproj/argo-cd/reposerver" "github.com/argoproj/argo-cd/util/argo" + cache_util "github.com/argoproj/argo-cd/util/cache" "github.com/argoproj/argo-cd/util/db" + grpc_util "github.com/argoproj/argo-cd/util/grpc" "github.com/argoproj/argo-cd/util/health" "github.com/argoproj/argo-cd/util/kube" + settings_util "github.com/argoproj/argo-cd/util/settings" + tlsutil "github.com/argoproj/argo-cd/util/tls" ) const ( @@ -58,6 +71,7 @@ type ApplicationController struct { db db.ArgoDB forceRefreshApps map[string]bool forceRefreshAppsMutex *sync.Mutex + appResources cache_util.Cache } type ApplicationControllerConfig struct { @@ -91,11 +105,112 @@ func NewApplicationController( forceRefreshApps: make(map[string]bool), forceRefreshAppsMutex: &sync.Mutex{}, auditLogger: argo.NewAuditLogger(namespace, kubeClientset, "application-controller"), + appResources: cache_util.NewInMemoryCache(24 * time.Hour), } ctrl.appInformer = ctrl.newApplicationInformer() return &ctrl } +func (ctrl *ApplicationController) setAppResources(appName string, resources []appv1.ResourceState) { + err := ctrl.appResources.Set(&cache_util.Item{Object: resources, Key: appName}) + if err != nil { + log.Warnf("Unable to save app resources state in cache: %v", err) + } +} + +func (ctrl *ApplicationController) Resources(ctx context.Context, q *services.ResourcesQuery) (*services.ResourcesResponse, error) { + resources := make([]appv1.ResourceState, 0) + if q.ApplicationName == nil { + return nil, status.Errorf(codes.InvalidArgument, "application name is not specified") + } + err := ctrl.appResources.Get(*q.ApplicationName, &resources) + if err == nil { + items := make([]*appv1.ResourceState, 0) + for i := range resources { + res := resources[i] + obj, err := res.TargetObject() + if err != nil { + return nil, err + } + if obj == nil { + obj, err = res.LiveObject() + if err != nil { + return nil, err + } + } + if obj == nil { + return nil, fmt.Errorf("both live and target objects are nil") + } + gvk := obj.GroupVersionKind() + if q.Version != nil && gvk.Version != *q.Version { + continue + } + if q.Group != nil && gvk.Group != *q.Group { + continue + } + if q.Kind != nil && gvk.Kind != *q.Kind { + continue + } + var data map[string]interface{} + res.LiveState, data = hideSecretData(res.LiveState, nil) + res.TargetState, _ = hideSecretData(res.TargetState, data) + res.ChildLiveResources = hideNodesSecrets(res.ChildLiveResources) + items = append(items, &res) + } + return &services.ResourcesResponse{Items: items}, nil + } + return &services.ResourcesResponse{Items: make([]*appv1.ResourceState, 0)}, nil +} + +func toString(val interface{}) string { + if val == nil { + return "" + } + return fmt.Sprintf("%s", val) +} + +// hideSecretData checks if given object kind is Secret, replaces data keys with stars and returns unchanged data map. The method additionally check if data key if different +// from corresponding key of optional parameter `otherData` and adds extra star to keep information about difference. So if secret data is out of sync user still can see which +// fields are different. +func hideSecretData(state string, otherData map[string]interface{}) (string, map[string]interface{}) { + obj, err := appv1.UnmarshalToUnstructured(state) + if err == nil { + if obj != nil && obj.GetKind() == kube.SecretKind { + if data, ok, err := unstructured.NestedMap(obj.Object, "data"); err == nil && ok { + unchangedData := make(map[string]interface{}) + for k, v := range data { + unchangedData[k] = v + } + for k := range data { + replacement := "********" + if otherData != nil { + if val, ok := otherData[k]; ok && toString(val) != toString(data[k]) { + replacement = replacement + "*" + } + } + data[k] = replacement + } + _ = unstructured.SetNestedMap(obj.Object, data, "data") + newState, err := json.Marshal(obj) + if err == nil { + return string(newState), unchangedData + } + } + } + } + return state, nil +} + +func hideNodesSecrets(nodes []appv1.ResourceNode) []appv1.ResourceNode { + for i := range nodes { + node := nodes[i] + node.State, _ = hideSecretData(node.State, nil) + node.Children = hideNodesSecrets(node.Children) + nodes[i] = node + } + return nodes +} + // Run starts the Application CRD controller. func (ctrl *ApplicationController) Run(ctx context.Context, statusProcessors int, operationProcessors int) { defer runtime.HandleCrash() @@ -127,6 +242,42 @@ func (ctrl *ApplicationController) Run(ctx context.Context, statusProcessors int <-ctx.Done() } +func (ctrl *ApplicationController) CreateGRPC(tlsConfCustomizer tlsutil.ConfigCustomizer) (*grpc.Server, error) { + // generate TLS cert + hosts := []string{ + "localhost", + "application-controller", + } + cert, err := tlsutil.GenerateX509KeyPair(tlsutil.CertOptions{ + Hosts: hosts, + Organization: "Argo CD", + IsCA: true, + }) + + if err != nil { + return nil, err + } + + tlsConfig := &tls.Config{Certificates: []tls.Certificate{*cert}} + tlsConfCustomizer(tlsConfig) + + logEntry := log.NewEntry(log.New()) + server := grpc.NewServer( + grpc.Creds(credentials.NewTLS(tlsConfig)), + grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( + grpc_logrus.StreamServerInterceptor(logEntry), + grpc_util.PanicLoggerStreamServerInterceptor(logEntry), + )), + grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer( + grpc_logrus.UnaryServerInterceptor(logEntry), + grpc_util.PanicLoggerUnaryServerInterceptor(logEntry), + )), + ) + services.RegisterApplicationServiceServer(server, ctrl) + reflection.Register(server) + return server, nil +} + func (ctrl *ApplicationController) forceAppRefresh(appName string) { ctrl.forceRefreshAppsMutex.Lock() defer ctrl.forceRefreshAppsMutex.Unlock() @@ -542,7 +693,7 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo return } - comparisonResult, manifestInfo, compConditions, err := ctrl.appStateManager.CompareAppState(app, "", nil) + comparisonResult, manifestInfo, resources, compConditions, err := ctrl.appStateManager.CompareAppState(app, "", nil) if err != nil { conditions = append(conditions, appv1.ApplicationCondition{Type: appv1.ApplicationConditionComparisonError, Message: err.Error()}) } else { @@ -554,10 +705,11 @@ func (ctrl *ApplicationController) processAppRefreshQueueItem() (processNext boo parameters = manifestInfo.Params } - healthState, err := setApplicationHealth(ctrl.kubectl, comparisonResult) + healthState, err := setApplicationHealth(ctrl.kubectl, comparisonResult, resources) if err != nil { conditions = append(conditions, appv1.ApplicationCondition{Type: appv1.ApplicationConditionComparisonError, Message: err.Error()}) } + ctrl.setAppResources(app.Name, resources) syncErrCond := ctrl.autoSync(app, comparisonResult) if syncErrCond != nil { @@ -645,13 +797,13 @@ func (ctrl *ApplicationController) refreshAppConditions(app *appv1.Application) } // setApplicationHealth updates the health statuses of all resources performed in the comparison -func setApplicationHealth(kubectl kube.Kubectl, comparisonResult *appv1.ComparisonResult) (*appv1.HealthStatus, error) { +func setApplicationHealth(kubectl kube.Kubectl, comparisonResult *appv1.ComparisonResult, resources []appv1.ResourceState) (*appv1.HealthStatus, error) { var savedErr error appHealth := appv1.HealthStatus{Status: appv1.HealthStatusHealthy} if comparisonResult.Status == appv1.ComparisonStatusUnknown { appHealth.Status = appv1.HealthStatusUnknown } - for i, resource := range comparisonResult.Resources { + for i, resource := range resources { if resource.LiveState == "null" { resource.Health = appv1.HealthStatus{Status: appv1.HealthStatusMissing} } else { @@ -666,7 +818,8 @@ func setApplicationHealth(kubectl kube.Kubectl, comparisonResult *appv1.Comparis } resource.Health = *healthState } - comparisonResult.Resources[i] = resource + resources[i] = resource + comparisonResult.Resources[i].Health = resource.Health if health.IsWorse(appHealth.Status, resource.Health.Status) { appHealth.Status = resource.Health.Status } @@ -776,7 +929,7 @@ func (ctrl *ApplicationController) autoSync(app *appv1.Application, comparisonRe }, } appIf := ctrl.applicationClientset.ArgoprojV1alpha1().Applications(app.Namespace) - _, err := argo.SetAppOperation(context.Background(), appIf, ctrl.auditLogger, app.Name, &op) + _, err := argo.SetAppOperation(appIf, app.Name, &op) if err != nil { logCtx.Errorf("Failed to initiate auto-sync to %s: %v", desiredCommitSHA, err) return &appv1.ApplicationCondition{Type: appv1.ApplicationConditionSyncError, Message: err.Error()} diff --git a/controller/clientset.go b/controller/clientset.go new file mode 100644 index 0000000000000..57a500963e28b --- /dev/null +++ b/controller/clientset.go @@ -0,0 +1,36 @@ +package controller + +import ( + "crypto/tls" + + log "github.com/sirupsen/logrus" + + "github.com/argoproj/argo-cd/controller/services" + "github.com/argoproj/argo-cd/util" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +// Clientset represents controller server api clients +type Clientset interface { + NewApplicationServiceClient() (util.Closer, services.ApplicationServiceClient, error) +} + +type clientSet struct { + address string +} + +func (c *clientSet) NewApplicationServiceClient() (util.Closer, services.ApplicationServiceClient, error) { + conn, err := grpc.Dial(c.address, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{InsecureSkipVerify: true}))) + if err != nil { + log.Errorf("Unable to connect to repository service with address %s", c.address) + return nil, nil, err + } + return conn, services.NewApplicationServiceClient(conn), nil +} + +// NewAppControllerClientset creates new instance of controller server Clientset +func NewAppControllerClientset(address string) Clientset { + return &clientSet{address: address} +} diff --git a/controller/services/application.pb.go b/controller/services/application.pb.go new file mode 100644 index 0000000000000..f90ee4f47a6ce --- /dev/null +++ b/controller/services/application.pb.go @@ -0,0 +1,758 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: controller/services/application.proto + +package services // import "github.com/argoproj/argo-cd/controller/services" + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" + +import context "golang.org/x/net/context" +import grpc "google.golang.org/grpc" + +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +type ResourcesQuery struct { + ApplicationName *string `protobuf:"bytes,1,req,name=applicationName" json:"applicationName,omitempty"` + Group *string `protobuf:"bytes,2,opt,name=group" json:"group,omitempty"` + Version *string `protobuf:"bytes,3,opt,name=version" json:"version,omitempty"` + Kind *string `protobuf:"bytes,4,opt,name=kind" json:"kind,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResourcesQuery) Reset() { *m = ResourcesQuery{} } +func (m *ResourcesQuery) String() string { return proto.CompactTextString(m) } +func (*ResourcesQuery) ProtoMessage() {} +func (*ResourcesQuery) Descriptor() ([]byte, []int) { + return fileDescriptor_application_b7c966df2a6bd563, []int{0} +} +func (m *ResourcesQuery) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourcesQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourcesQuery.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResourcesQuery) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourcesQuery.Merge(dst, src) +} +func (m *ResourcesQuery) XXX_Size() int { + return m.Size() +} +func (m *ResourcesQuery) XXX_DiscardUnknown() { + xxx_messageInfo_ResourcesQuery.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourcesQuery proto.InternalMessageInfo + +func (m *ResourcesQuery) GetApplicationName() string { + if m != nil && m.ApplicationName != nil { + return *m.ApplicationName + } + return "" +} + +func (m *ResourcesQuery) GetGroup() string { + if m != nil && m.Group != nil { + return *m.Group + } + return "" +} + +func (m *ResourcesQuery) GetVersion() string { + if m != nil && m.Version != nil { + return *m.Version + } + return "" +} + +func (m *ResourcesQuery) GetKind() string { + if m != nil && m.Kind != nil { + return *m.Kind + } + return "" +} + +type ResourcesResponse struct { + Items []*v1alpha1.ResourceState `protobuf:"bytes,1,rep,name=items" json:"items,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResourcesResponse) Reset() { *m = ResourcesResponse{} } +func (m *ResourcesResponse) String() string { return proto.CompactTextString(m) } +func (*ResourcesResponse) ProtoMessage() {} +func (*ResourcesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_application_b7c966df2a6bd563, []int{1} +} +func (m *ResourcesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourcesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *ResourcesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourcesResponse.Merge(dst, src) +} +func (m *ResourcesResponse) XXX_Size() int { + return m.Size() +} +func (m *ResourcesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ResourcesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourcesResponse proto.InternalMessageInfo + +func (m *ResourcesResponse) GetItems() []*v1alpha1.ResourceState { + if m != nil { + return m.Items + } + return nil +} + +func init() { + proto.RegisterType((*ResourcesQuery)(nil), "github.com.argoproj.argo_cd.controller.services.ResourcesQuery") + proto.RegisterType((*ResourcesResponse)(nil), "github.com.argoproj.argo_cd.controller.services.ResourcesResponse") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for ApplicationService service + +type ApplicationServiceClient interface { + // Resources returns information about expected and observed application resources + Resources(ctx context.Context, in *ResourcesQuery, opts ...grpc.CallOption) (*ResourcesResponse, error) +} + +type applicationServiceClient struct { + cc *grpc.ClientConn +} + +func NewApplicationServiceClient(cc *grpc.ClientConn) ApplicationServiceClient { + return &applicationServiceClient{cc} +} + +func (c *applicationServiceClient) Resources(ctx context.Context, in *ResourcesQuery, opts ...grpc.CallOption) (*ResourcesResponse, error) { + out := new(ResourcesResponse) + err := c.cc.Invoke(ctx, "/github.com.argoproj.argo_cd.controller.services.ApplicationService/Resources", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ApplicationService service + +type ApplicationServiceServer interface { + // Resources returns information about expected and observed application resources + Resources(context.Context, *ResourcesQuery) (*ResourcesResponse, error) +} + +func RegisterApplicationServiceServer(s *grpc.Server, srv ApplicationServiceServer) { + s.RegisterService(&_ApplicationService_serviceDesc, srv) +} + +func _ApplicationService_Resources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResourcesQuery) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ApplicationServiceServer).Resources(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/github.com.argoproj.argo_cd.controller.services.ApplicationService/Resources", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ApplicationServiceServer).Resources(ctx, req.(*ResourcesQuery)) + } + return interceptor(ctx, in, info, handler) +} + +var _ApplicationService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "github.com.argoproj.argo_cd.controller.services.ApplicationService", + HandlerType: (*ApplicationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Resources", + Handler: _ApplicationService_Resources_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "controller/services/application.proto", +} + +func (m *ResourcesQuery) 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 *ResourcesQuery) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ApplicationName == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("applicationName") + } else { + dAtA[i] = 0xa + i++ + i = encodeVarintApplication(dAtA, i, uint64(len(*m.ApplicationName))) + i += copy(dAtA[i:], *m.ApplicationName) + } + if m.Group != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintApplication(dAtA, i, uint64(len(*m.Group))) + i += copy(dAtA[i:], *m.Group) + } + if m.Version != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintApplication(dAtA, i, uint64(len(*m.Version))) + i += copy(dAtA[i:], *m.Version) + } + if m.Kind != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintApplication(dAtA, i, uint64(len(*m.Kind))) + i += copy(dAtA[i:], *m.Kind) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ResourcesResponse) 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 *ResourcesResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for _, msg := range m.Items { + dAtA[i] = 0xa + i++ + i = encodeVarintApplication(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func encodeVarintApplication(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 *ResourcesQuery) Size() (n int) { + var l int + _ = l + if m.ApplicationName != nil { + l = len(*m.ApplicationName) + n += 1 + l + sovApplication(uint64(l)) + } + if m.Group != nil { + l = len(*m.Group) + n += 1 + l + sovApplication(uint64(l)) + } + if m.Version != nil { + l = len(*m.Version) + n += 1 + l + sovApplication(uint64(l)) + } + if m.Kind != nil { + l = len(*m.Kind) + n += 1 + l + sovApplication(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ResourcesResponse) Size() (n int) { + var l int + _ = l + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovApplication(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovApplication(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozApplication(x uint64) (n int) { + return sovApplication(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ResourcesQuery) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplication + } + 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: ResourcesQuery: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourcesQuery: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplication + } + 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 ErrInvalidLengthApplication + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.ApplicationName = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplication + } + 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 ErrInvalidLengthApplication + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Group = &s + iNdEx = postIndex + case 3: + 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 ErrIntOverflowApplication + } + 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 ErrInvalidLengthApplication + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Version = &s + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplication + } + 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 ErrInvalidLengthApplication + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Kind = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApplication(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthApplication + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("applicationName") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourcesResponse) 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 ErrIntOverflowApplication + } + 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: ResourcesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplication + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApplication + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, &v1alpha1.ResourceState{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApplication(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthApplication + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipApplication(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, ErrIntOverflowApplication + } + 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, ErrIntOverflowApplication + } + 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, ErrIntOverflowApplication + } + 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, ErrInvalidLengthApplication + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowApplication + } + 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 := skipApplication(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 ( + ErrInvalidLengthApplication = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowApplication = fmt.Errorf("proto: integer overflow") +) + +func init() { + proto.RegisterFile("controller/services/application.proto", fileDescriptor_application_b7c966df2a6bd563) +} + +var fileDescriptor_application_b7c966df2a6bd563 = []byte{ + // 328 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xcb, 0x4a, 0x03, 0x31, + 0x14, 0x35, 0x7d, 0x20, 0x8d, 0xa0, 0x18, 0x5c, 0x0c, 0x5d, 0x94, 0x52, 0x10, 0x66, 0x63, 0x42, + 0xbb, 0x17, 0xb1, 0x2b, 0xdd, 0x08, 0x4e, 0x77, 0x2e, 0x94, 0x98, 0xb9, 0x4c, 0x63, 0xa7, 0x73, + 0x43, 0x92, 0x29, 0xb8, 0xf1, 0x23, 0xfc, 0x0b, 0xff, 0xc4, 0xa5, 0x9f, 0x20, 0xfd, 0x12, 0x71, + 0x86, 0xf4, 0x21, 0x52, 0xd0, 0xdd, 0xb9, 0x87, 0x39, 0xe7, 0xcc, 0x3d, 0x37, 0xf4, 0x54, 0x61, + 0xe1, 0x2d, 0xe6, 0x39, 0x58, 0xe1, 0xc0, 0x2e, 0xb4, 0x02, 0x27, 0xa4, 0x31, 0xb9, 0x56, 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 0xac, 0x7e, 0x86, 0x5d, 0xf0, 0x3f, 0x9e, 0x85, 0x6f, 0x17, 0xd9, + 0x1d, 0xff, 0xdf, 0x20, 0x34, 0x31, 0xd8, 0x1b, 0x9f, 0xbf, 0x2f, 0x7b, 0xe4, 0x63, 0xd9, 0x23, + 0x9f, 0xcb, 0x1e, 0xb9, 0x13, 0xbb, 0x2e, 0xff, 0xcb, 0x6b, 0xfb, 0x0a, 0x00, 0x00, 0xff, 0xff, + 0x8d, 0xcd, 0xc9, 0xf5, 0x83, 0x02, 0x00, 0x00, +} diff --git a/controller/services/application.proto b/controller/services/application.proto new file mode 100644 index 0000000000000..8213c90492f64 --- /dev/null +++ b/controller/services/application.proto @@ -0,0 +1,26 @@ +syntax = "proto2"; +option go_package = "github.com/argoproj/argo-cd/controller/services"; + +package github.com.argoproj.argo_cd.controller.services; + +import "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto"; + +message ResourcesQuery { + required string applicationName = 1; + optional string group = 2; + optional string version = 3; + optional string kind = 4; +} + +message ResourcesResponse { + repeated github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ResourceState items = 1; +} + + +// ApplicationService returns information about application +service ApplicationService { + + // Resources returns information about expected and observed application resources + rpc Resources(ResourcesQuery) returns (ResourcesResponse) { + } +} diff --git a/controller/state.go b/controller/state.go index cbe5b49edd615..f5ab99196ddba 100644 --- a/controller/state.go +++ b/controller/state.go @@ -32,7 +32,7 @@ const ( // AppStateManager defines methods which allow to compare application spec and actual application state. type AppStateManager interface { CompareAppState(app *v1alpha1.Application, revision string, overrides []v1alpha1.ComponentParameter) ( - *v1alpha1.ComparisonResult, *repository.ManifestResponse, []v1alpha1.ApplicationCondition, error) + *v1alpha1.ComparisonResult, *repository.ManifestResponse, []v1alpha1.ResourceState, []v1alpha1.ApplicationCondition, error) SyncAppState(app *v1alpha1.Application, state *v1alpha1.OperationState) } @@ -212,7 +212,7 @@ func (s *appStateManager) getLiveObjs(app *v1alpha1.Application, targetObjs []*u // revision and supplied overrides. If revision or overrides are empty, then compares against // revision and overrides in the app spec. func (s *appStateManager) CompareAppState(app *v1alpha1.Application, revision string, overrides []v1alpha1.ComponentParameter) ( - *v1alpha1.ComparisonResult, *repository.ManifestResponse, []v1alpha1.ApplicationCondition, error) { + *v1alpha1.ComparisonResult, *repository.ManifestResponse, []v1alpha1.ResourceState, []v1alpha1.ApplicationCondition, error) { failedToLoadObjs := false conditions := make([]v1alpha1.ApplicationCondition, 0) @@ -256,7 +256,7 @@ func (s *appStateManager) CompareAppState(app *v1alpha1.Application, revision st // Do the actual comparison diffResults, err := diff.DiffArray(targetObjs, controlledLiveObj) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } comparisonStatus := v1alpha1.ComparisonStatusSynced @@ -283,7 +283,7 @@ func (s *appStateManager) CompareAppState(app *v1alpha1.Application, revision st } else { targetObjBytes, err := json.Marshal(targetObjs[i].Object) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } resState.TargetState = string(targetObjBytes) } @@ -296,7 +296,7 @@ func (s *appStateManager) CompareAppState(app *v1alpha1.Application, revision st } else { liveObjBytes, err := json.Marshal(controlledLiveObj[i].Object) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } resState.LiveState = string(liveObjBytes) } @@ -309,7 +309,7 @@ func (s *appStateManager) CompareAppState(app *v1alpha1.Application, revision st if liveResource != nil { childResources, err := getChildren(liveResource, liveObjByFullName) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } resource.ChildLiveResources = childResources resources[i] = resource @@ -318,17 +318,42 @@ func (s *appStateManager) CompareAppState(app *v1alpha1.Application, revision st if failedToLoadObjs { comparisonStatus = v1alpha1.ComparisonStatusUnknown } + resourceSummaries := make([]v1alpha1.ResourceSummary, len(resources)) + for i := range resources { + obj, err := resources[i].LiveObject() + if err != nil { + return nil, nil, nil, nil, err + } + if obj == nil { + obj, err = resources[i].TargetObject() + if err != nil { + return nil, nil, nil, nil, err + } + } + if obj == nil { + return nil, nil, nil, nil, fmt.Errorf("both target and live object are nil") + } + gkv := obj.GroupVersionKind() + resourceSummaries[i] = v1alpha1.ResourceSummary{ + Name: obj.GetName(), + Kind: gkv.Kind, + Version: gkv.Version, + Group: gkv.Group, + Status: resources[i].Status, + Health: resources[i].Health, + } + } compResult := v1alpha1.ComparisonResult{ ComparedTo: app.Spec.Source, ComparedAt: metav1.Time{Time: time.Now().UTC()}, - Resources: resources, Status: comparisonStatus, + Resources: resourceSummaries, } if manifestInfo != nil { compResult.Revision = manifestInfo.Revision } - return &compResult, manifestInfo, conditions, nil + return &compResult, manifestInfo, resources, conditions, nil } func hasParent(obj *unstructured.Unstructured) bool { diff --git a/controller/sync.go b/controller/sync.go index 2c69f8f19b5a5..9bbb877341ae9 100644 --- a/controller/sync.go +++ b/controller/sync.go @@ -32,6 +32,7 @@ type syncContext struct { appName string proj *appv1.AppProject comparison *appv1.ComparisonResult + resources []appv1.ResourceState config *rest.Config dynamicIf dynamic.Interface disco discovery.DiscoveryInterface @@ -83,7 +84,7 @@ func (s *appStateManager) SyncAppState(app *appv1.Application, state *appv1.Oper revision = syncOp.Revision } - comparison, manifestInfo, conditions, err := s.CompareAppState(app, revision, overrides) + comparison, manifestInfo, resources, conditions, err := s.CompareAppState(app, revision, overrides) if err != nil { state.Phase = appv1.OperationError state.Message = err.Error() @@ -147,6 +148,7 @@ func (s *appStateManager) SyncAppState(app *appv1.Application, state *appv1.Oper opState: state, manifestInfo: manifestInfo, log: log.WithFields(log.Fields{"application": app.Name}), + resources: resources, } if state.Phase == appv1.OperationTerminating { @@ -233,7 +235,7 @@ func (sc *syncContext) forceAppRefresh() { // generateSyncTasks() generates the list of sync tasks we will be performing during this sync. func (sc *syncContext) generateSyncTasks() ([]syncTask, bool) { syncTasks := make([]syncTask, 0) - for _, resourceState := range sc.comparison.Resources { + for _, resourceState := range sc.resources { liveObj, err := resourceState.LiveObject() if err != nil { sc.setOperationPhase(appv1.OperationError, fmt.Sprintf("Failed to unmarshal live object: %v", err)) @@ -244,7 +246,10 @@ func (sc *syncContext) generateSyncTasks() ([]syncTask, bool) { sc.setOperationPhase(appv1.OperationError, fmt.Sprintf("Failed to unmarshal target object: %v", err)) return nil, false } - if sc.syncResources == nil || argo.ContainsSyncResource(liveObj, sc.syncResources) || argo.ContainsSyncResource(targetObj, sc.syncResources) { + if sc.syncResources == nil || + (liveObj != nil && argo.ContainsSyncResource(liveObj.GetName(), liveObj.GroupVersionKind(), sc.syncResources)) || + (targetObj != nil && argo.ContainsSyncResource(targetObj.GetName(), targetObj.GroupVersionKind(), sc.syncResources)) { + syncTask := syncTask{ liveObj: liveObj, targetObj: targetObj, @@ -253,7 +258,7 @@ func (sc *syncContext) generateSyncTasks() ([]syncTask, bool) { } } if len(syncTasks) == 0 { - if len(sc.comparison.Resources) == 0 { + if len(sc.resources) == 0 { sc.setOperationPhase(appv1.OperationError, fmt.Sprintf("Application has no resources")) } else { sc.setOperationPhase(appv1.OperationError, fmt.Sprintf("Specified resources filter does not match any application resource")) @@ -510,7 +515,7 @@ func (sc *syncContext) doHookSync(syncTasks []syncTask, hooks []*unstructured.Un // already started the post-sync phase, then we do not need to perform the health check. postSyncHooks, _ := sc.getHooks(appv1.HookTypePostSync) if len(postSyncHooks) > 0 && !sc.startedPostSyncPhase() { - healthState, err := setApplicationHealth(sc.kubectl, sc.comparison) + healthState, err := setApplicationHealth(sc.kubectl, sc.comparison, sc.resources) sc.log.Infof("PostSync application health check: %s", healthState.Status) if err != nil { sc.setOperationPhase(appv1.OperationError, fmt.Sprintf("failed to check application health: %v", err)) diff --git a/controller/sync_test.go b/controller/sync_test.go index 01dbdcffe5b5f..ebdfad915a717 100644 --- a/controller/sync_test.go +++ b/controller/sync_test.go @@ -99,16 +99,13 @@ func newTestSyncCtx(resources ...*v1.APIResourceList) *syncContext { func TestSyncCreateInSortedOrder(t *testing.T) { syncCtx := newTestSyncCtx() syncCtx.kubectl = mockKubectlCmd{} - syncCtx.comparison = &v1alpha1.ComparisonResult{ - Resources: []v1alpha1.ResourceState{{ - LiveState: "", - TargetState: "{\"kind\":\"pod\"}", - }, { - LiveState: "", - TargetState: "{\"kind\":\"service\"}", - }, - }, - } + syncCtx.resources = []v1alpha1.ResourceState{{ + LiveState: "", + TargetState: "{\"kind\":\"pod\"}", + }, { + LiveState: "", + TargetState: "{\"kind\":\"service\"}", + }} syncCtx.sync() assert.Len(t, syncCtx.syncRes.Resources, 2) for i := range syncCtx.syncRes.Resources { @@ -143,12 +140,10 @@ func TestSyncCreateNotWhitelistedClusterResources(t *testing.T) { } syncCtx.kubectl = mockKubectlCmd{} - syncCtx.comparison = &v1alpha1.ComparisonResult{ - Resources: []v1alpha1.ResourceState{{ - LiveState: "", - TargetState: `{"apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", "metadata": {"name": "argo-ui-cluster-role" }}`, - }}, - } + syncCtx.resources = []v1alpha1.ResourceState{{ + LiveState: "", + TargetState: `{"apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", "metadata": {"name": "argo-ui-cluster-role" }}`, + }} syncCtx.sync() assert.Len(t, syncCtx.syncRes.Resources, 1) assert.Equal(t, v1alpha1.ResourceDetailsSyncFailed, syncCtx.syncRes.Resources[0].Status) @@ -163,12 +158,10 @@ func TestSyncBlacklistedNamespacedResources(t *testing.T) { } syncCtx.kubectl = mockKubectlCmd{} - syncCtx.comparison = &v1alpha1.ComparisonResult{ - Resources: []v1alpha1.ResourceState{{ - LiveState: "", - TargetState: "{\"kind\":\"deployment\"}", - }}, - } + syncCtx.resources = []v1alpha1.ResourceState{{ + LiveState: "", + TargetState: "{\"kind\":\"deployment\"}", + }} syncCtx.sync() assert.Len(t, syncCtx.syncRes.Resources, 1) assert.Equal(t, v1alpha1.ResourceDetailsSyncFailed, syncCtx.syncRes.Resources[0].Status) @@ -178,16 +171,13 @@ func TestSyncBlacklistedNamespacedResources(t *testing.T) { func TestSyncSuccessfully(t *testing.T) { syncCtx := newTestSyncCtx() syncCtx.kubectl = mockKubectlCmd{} - syncCtx.comparison = &v1alpha1.ComparisonResult{ - Resources: []v1alpha1.ResourceState{{ - LiveState: "", - TargetState: "{\"kind\":\"service\"}", - }, { - LiveState: "{\"kind\":\"pod\"}", - TargetState: "", - }, - }, - } + syncCtx.resources = []v1alpha1.ResourceState{{ + LiveState: "", + TargetState: "{\"kind\":\"service\"}", + }, { + LiveState: "{\"kind\":\"pod\"}", + TargetState: "", + }} syncCtx.sync() assert.Len(t, syncCtx.syncRes.Resources, 2) for i := range syncCtx.syncRes.Resources { @@ -206,16 +196,13 @@ func TestSyncSuccessfully(t *testing.T) { func TestSyncDeleteSuccessfully(t *testing.T) { syncCtx := newTestSyncCtx() syncCtx.kubectl = mockKubectlCmd{} - syncCtx.comparison = &v1alpha1.ComparisonResult{ - Resources: []v1alpha1.ResourceState{{ - LiveState: "{\"kind\":\"service\"}", - TargetState: "", - }, { - LiveState: "{\"kind\":\"pod\"}", - TargetState: "", - }, - }, - } + syncCtx.resources = []v1alpha1.ResourceState{{ + LiveState: "{\"kind\":\"service\"}", + TargetState: "", + }, { + LiveState: "{\"kind\":\"pod\"}", + TargetState: "", + }} syncCtx.sync() for i := range syncCtx.syncRes.Resources { if syncCtx.syncRes.Resources[i].Kind == "pod" { @@ -240,13 +227,10 @@ func TestSyncCreateFailure(t *testing.T) { }, }, } - syncCtx.comparison = &v1alpha1.ComparisonResult{ - Resources: []v1alpha1.ResourceState{{ - LiveState: "", - TargetState: "{\"kind\":\"service\", \"metadata\":{\"name\":\"test-service\"}}", - }, - }, - } + syncCtx.resources = []v1alpha1.ResourceState{{ + LiveState: "", + TargetState: "{\"kind\":\"service\", \"metadata\":{\"name\":\"test-service\"}}", + }} syncCtx.sync() assert.Len(t, syncCtx.syncRes.Resources, 1) assert.Equal(t, v1alpha1.ResourceDetailsSyncFailed, syncCtx.syncRes.Resources[0].Status) @@ -262,13 +246,10 @@ func TestSyncPruneFailure(t *testing.T) { }, }, } - syncCtx.comparison = &v1alpha1.ComparisonResult{ - Resources: []v1alpha1.ResourceState{{ - LiveState: "{\"kind\":\"service\", \"metadata\":{\"name\":\"test-service\"}}", - TargetState: "", - }, - }, - } + syncCtx.resources = []v1alpha1.ResourceState{{ + LiveState: "{\"kind\":\"service\", \"metadata\":{\"name\":\"test-service\"}}", + TargetState: "", + }} syncCtx.sync() assert.Len(t, syncCtx.syncRes.Resources, 1) assert.Equal(t, v1alpha1.ResourceDetailsSyncFailed, syncCtx.syncRes.Resources[0].Status) diff --git a/hack/generate-proto.sh b/hack/generate-proto.sh index 946a89d1811a3..d71251bda9f2a 100755 --- a/hack/generate-proto.sh +++ b/hack/generate-proto.sh @@ -59,7 +59,7 @@ go build -i -o dist/protoc-gen-grpc-gateway ./vendor/github.com/grpc-ecosystem/g go build -i -o dist/protoc-gen-swagger ./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger # Generate server//(.pb.go|.pb.gw.go) -PROTO_FILES=$(find $PROJECT_ROOT \( -name "*.proto" -and -path '*/server/*' -or -path '*/reposerver/*' -and -name "*.proto" \)) +PROTO_FILES=$(find $PROJECT_ROOT \( -name "*.proto" -and -path '*/server/*' -or -path '*/reposerver/*' -and -name "*.proto" -or -path '*/controller/*' -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. @@ -120,3 +120,4 @@ clean_swagger() { collect_swagger server 21 clean_swagger server clean_swagger reposerver +clean_swagger controller diff --git a/manifests/base/application-controller-deployment.yaml b/manifests/base/application-controller-deployment.yaml index b49faf3ee4d80..478499b4592ba 100644 --- a/manifests/base/application-controller-deployment.yaml +++ b/manifests/base/application-controller-deployment.yaml @@ -20,6 +20,6 @@ spec: - "20" - --operation-processors - "10" - image: argoproj/argocd-application-controller:latest + image: argoproj/argocd:latest name: application-controller serviceAccountName: application-controller diff --git a/manifests/base/application-controller-service.yaml b/manifests/base/application-controller-service.yaml new file mode 100644 index 0000000000000..0c58a8061ce1e --- /dev/null +++ b/manifests/base/application-controller-service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: application-controller +spec: + ports: + - port: 8083 + targetPort: 8083 + selector: + app: application-controller diff --git a/manifests/base/kustomization.yaml b/manifests/base/kustomization.yaml index fa563017ab068..6d7f07ec51512 100644 --- a/manifests/base/kustomization.yaml +++ b/manifests/base/kustomization.yaml @@ -8,6 +8,7 @@ resources: - application-controller-role.yaml - application-controller-rolebinding.yaml - application-controller-deployment.yaml +- application-controller-service.yaml - argocd-server-sa.yaml - argocd-server-role.yaml - argocd-server-rolebinding.yaml @@ -23,11 +24,7 @@ resources: - dex-server-service.yaml imageTags: -- name: argoproj/argocd-server +- name: argoproj/argocd newTag: latest - name: argoproj/argocd-ui newTag: latest -- name: argoproj/argocd-repo-server - newTag: latest -- name: argoproj/argocd-application-controller - newTag: latest diff --git a/manifests/install.yaml b/manifests/install.yaml index d088f65138c45..83938f5e35fc8 100644 --- a/manifests/install.yaml +++ b/manifests/install.yaml @@ -259,6 +259,17 @@ type: Opaque --- apiVersion: v1 kind: Service +metadata: + name: application-controller +spec: + ports: + - port: 8083 + targetPort: 8083 + selector: + app: application-controller +--- +apiVersion: v1 +kind: Service metadata: labels: app: argocd-metrics @@ -339,7 +350,7 @@ spec: - "20" - --operation-processors - "10" - image: jessesuen/argocd-application-controller:latest + image: argoproj/argocd:latest name: application-controller serviceAccountName: application-controller --- @@ -360,7 +371,7 @@ spec: containers: - command: - argocd-repo-server - image: jessesuen/argocd:latest + image: argoproj/argocd:latest name: argocd-repo-server ports: - containerPort: 8081 @@ -388,7 +399,7 @@ spec: - argocd-server - --staticassets - /shared/app - image: jessesuen/argocd:latest + image: argoproj/argocd:latest name: argocd-server readinessProbe: httpGet: @@ -405,7 +416,7 @@ spec: - -r - /app - /shared - image: jessesuen/argocd-ui:latest + image: argoproj/argocd-ui:latest name: ui volumeMounts: - mountPath: /shared @@ -445,7 +456,7 @@ spec: - cp - /usr/local/bin/argocd-util - /shared - image: jessesuen/argocd:latest + image: argoproj/argocd:latest name: copyutil volumeMounts: - mountPath: /shared diff --git a/manifests/namespace-install.yaml b/manifests/namespace-install.yaml index ff113f272e991..cd5a0f30ff2ea 100644 --- a/manifests/namespace-install.yaml +++ b/manifests/namespace-install.yaml @@ -192,6 +192,17 @@ type: Opaque --- apiVersion: v1 kind: Service +metadata: + name: application-controller +spec: + ports: + - port: 8083 + targetPort: 8083 + selector: + app: application-controller +--- +apiVersion: v1 +kind: Service metadata: labels: app: argocd-metrics @@ -272,7 +283,7 @@ spec: - "20" - --operation-processors - "10" - image: jessesuen/argocd-application-controller:latest + image: argoproj/argocd:latest name: application-controller serviceAccountName: application-controller --- @@ -293,7 +304,7 @@ spec: containers: - command: - argocd-repo-server - image: jessesuen/argocd:latest + image: argoproj/argocd:latest name: argocd-repo-server ports: - containerPort: 8081 @@ -321,7 +332,7 @@ spec: - argocd-server - --staticassets - /shared/app - image: jessesuen/argocd:latest + image: argoproj/argocd:latest name: argocd-server readinessProbe: httpGet: @@ -338,7 +349,7 @@ spec: - -r - /app - /shared - image: jessesuen/argocd-ui:latest + image: argoproj/argocd-ui:latest name: ui volumeMounts: - mountPath: /shared @@ -378,7 +389,7 @@ spec: - cp - /usr/local/bin/argocd-util - /shared - image: jessesuen/argocd:latest + image: argoproj/argocd:latest name: copyutil volumeMounts: - mountPath: /shared diff --git a/pkg/apis/application/v1alpha1/generated.pb.go b/pkg/apis/application/v1alpha1/generated.pb.go index e8a85ea35c860..850ed61161fa4 100644 --- a/pkg/apis/application/v1alpha1/generated.pb.go +++ b/pkg/apis/application/v1alpha1/generated.pb.go @@ -30,7 +30,7 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package func (m *AWSAuthConfig) Reset() { *m = AWSAuthConfig{} } func (*AWSAuthConfig) ProtoMessage() {} func (*AWSAuthConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{0} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{0} } func (m *AWSAuthConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -58,7 +58,7 @@ var xxx_messageInfo_AWSAuthConfig proto.InternalMessageInfo func (m *AppProject) Reset() { *m = AppProject{} } func (*AppProject) ProtoMessage() {} func (*AppProject) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{1} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{1} } func (m *AppProject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -86,7 +86,7 @@ var xxx_messageInfo_AppProject proto.InternalMessageInfo func (m *AppProjectList) Reset() { *m = AppProjectList{} } func (*AppProjectList) ProtoMessage() {} func (*AppProjectList) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{2} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{2} } func (m *AppProjectList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -114,7 +114,7 @@ var xxx_messageInfo_AppProjectList proto.InternalMessageInfo func (m *AppProjectSpec) Reset() { *m = AppProjectSpec{} } func (*AppProjectSpec) ProtoMessage() {} func (*AppProjectSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{3} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{3} } func (m *AppProjectSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -142,7 +142,7 @@ var xxx_messageInfo_AppProjectSpec proto.InternalMessageInfo func (m *Application) Reset() { *m = Application{} } func (*Application) ProtoMessage() {} func (*Application) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{4} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{4} } func (m *Application) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -170,7 +170,7 @@ var xxx_messageInfo_Application proto.InternalMessageInfo func (m *ApplicationCondition) Reset() { *m = ApplicationCondition{} } func (*ApplicationCondition) ProtoMessage() {} func (*ApplicationCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{5} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{5} } func (m *ApplicationCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -198,7 +198,7 @@ var xxx_messageInfo_ApplicationCondition proto.InternalMessageInfo func (m *ApplicationDestination) Reset() { *m = ApplicationDestination{} } func (*ApplicationDestination) ProtoMessage() {} func (*ApplicationDestination) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{6} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{6} } func (m *ApplicationDestination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -226,7 +226,7 @@ var xxx_messageInfo_ApplicationDestination proto.InternalMessageInfo func (m *ApplicationList) Reset() { *m = ApplicationList{} } func (*ApplicationList) ProtoMessage() {} func (*ApplicationList) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{7} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{7} } func (m *ApplicationList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -254,7 +254,7 @@ var xxx_messageInfo_ApplicationList proto.InternalMessageInfo func (m *ApplicationSource) Reset() { *m = ApplicationSource{} } func (*ApplicationSource) ProtoMessage() {} func (*ApplicationSource) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{8} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{8} } func (m *ApplicationSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -282,7 +282,7 @@ var xxx_messageInfo_ApplicationSource proto.InternalMessageInfo func (m *ApplicationSpec) Reset() { *m = ApplicationSpec{} } func (*ApplicationSpec) ProtoMessage() {} func (*ApplicationSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{9} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{9} } func (m *ApplicationSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +310,7 @@ var xxx_messageInfo_ApplicationSpec proto.InternalMessageInfo func (m *ApplicationStatus) Reset() { *m = ApplicationStatus{} } func (*ApplicationStatus) ProtoMessage() {} func (*ApplicationStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{10} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{10} } func (m *ApplicationStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -338,7 +338,7 @@ var xxx_messageInfo_ApplicationStatus proto.InternalMessageInfo func (m *ApplicationWatchEvent) Reset() { *m = ApplicationWatchEvent{} } func (*ApplicationWatchEvent) ProtoMessage() {} func (*ApplicationWatchEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{11} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{11} } func (m *ApplicationWatchEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -366,7 +366,7 @@ var xxx_messageInfo_ApplicationWatchEvent proto.InternalMessageInfo func (m *Cluster) Reset() { *m = Cluster{} } func (*Cluster) ProtoMessage() {} func (*Cluster) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{12} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{12} } func (m *Cluster) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -394,7 +394,7 @@ var xxx_messageInfo_Cluster proto.InternalMessageInfo func (m *ClusterConfig) Reset() { *m = ClusterConfig{} } func (*ClusterConfig) ProtoMessage() {} func (*ClusterConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{13} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{13} } func (m *ClusterConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -422,7 +422,7 @@ var xxx_messageInfo_ClusterConfig proto.InternalMessageInfo func (m *ClusterList) Reset() { *m = ClusterList{} } func (*ClusterList) ProtoMessage() {} func (*ClusterList) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{14} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{14} } func (m *ClusterList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,7 +450,7 @@ var xxx_messageInfo_ClusterList proto.InternalMessageInfo func (m *ComparisonResult) Reset() { *m = ComparisonResult{} } func (*ComparisonResult) ProtoMessage() {} func (*ComparisonResult) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{15} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{15} } func (m *ComparisonResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -478,7 +478,7 @@ var xxx_messageInfo_ComparisonResult proto.InternalMessageInfo func (m *ComponentParameter) Reset() { *m = ComponentParameter{} } func (*ComponentParameter) ProtoMessage() {} func (*ComponentParameter) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{16} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{16} } func (m *ComponentParameter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -506,7 +506,7 @@ var xxx_messageInfo_ComponentParameter proto.InternalMessageInfo func (m *ConnectionState) Reset() { *m = ConnectionState{} } func (*ConnectionState) ProtoMessage() {} func (*ConnectionState) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{17} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{17} } func (m *ConnectionState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -534,7 +534,7 @@ var xxx_messageInfo_ConnectionState proto.InternalMessageInfo func (m *DeploymentInfo) Reset() { *m = DeploymentInfo{} } func (*DeploymentInfo) ProtoMessage() {} func (*DeploymentInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{18} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{18} } func (m *DeploymentInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -562,7 +562,7 @@ var xxx_messageInfo_DeploymentInfo proto.InternalMessageInfo func (m *HealthStatus) Reset() { *m = HealthStatus{} } func (*HealthStatus) ProtoMessage() {} func (*HealthStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{19} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{19} } func (m *HealthStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -590,7 +590,7 @@ var xxx_messageInfo_HealthStatus proto.InternalMessageInfo func (m *HookStatus) Reset() { *m = HookStatus{} } func (*HookStatus) ProtoMessage() {} func (*HookStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{20} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{20} } func (m *HookStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -618,7 +618,7 @@ var xxx_messageInfo_HookStatus proto.InternalMessageInfo func (m *JWTToken) Reset() { *m = JWTToken{} } func (*JWTToken) ProtoMessage() {} func (*JWTToken) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{21} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{21} } func (m *JWTToken) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -646,7 +646,7 @@ var xxx_messageInfo_JWTToken proto.InternalMessageInfo func (m *Operation) Reset() { *m = Operation{} } func (*Operation) ProtoMessage() {} func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{22} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{22} } func (m *Operation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -674,7 +674,7 @@ var xxx_messageInfo_Operation proto.InternalMessageInfo func (m *OperationState) Reset() { *m = OperationState{} } func (*OperationState) ProtoMessage() {} func (*OperationState) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{23} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{23} } func (m *OperationState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -702,7 +702,7 @@ var xxx_messageInfo_OperationState proto.InternalMessageInfo func (m *ParameterOverrides) Reset() { *m = ParameterOverrides{} } func (*ParameterOverrides) ProtoMessage() {} func (*ParameterOverrides) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{24} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{24} } func (m *ParameterOverrides) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -730,7 +730,7 @@ var xxx_messageInfo_ParameterOverrides proto.InternalMessageInfo func (m *ProjectRole) Reset() { *m = ProjectRole{} } func (*ProjectRole) ProtoMessage() {} func (*ProjectRole) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{25} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{25} } func (m *ProjectRole) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,7 +758,7 @@ var xxx_messageInfo_ProjectRole proto.InternalMessageInfo func (m *Repository) Reset() { *m = Repository{} } func (*Repository) ProtoMessage() {} func (*Repository) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{26} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{26} } func (m *Repository) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -786,7 +786,7 @@ var xxx_messageInfo_Repository proto.InternalMessageInfo func (m *RepositoryList) Reset() { *m = RepositoryList{} } func (*RepositoryList) ProtoMessage() {} func (*RepositoryList) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{27} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{27} } func (m *RepositoryList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -814,7 +814,7 @@ var xxx_messageInfo_RepositoryList proto.InternalMessageInfo func (m *ResourceDetails) Reset() { *m = ResourceDetails{} } func (*ResourceDetails) ProtoMessage() {} func (*ResourceDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{28} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{28} } func (m *ResourceDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -842,7 +842,7 @@ var xxx_messageInfo_ResourceDetails proto.InternalMessageInfo func (m *ResourceNode) Reset() { *m = ResourceNode{} } func (*ResourceNode) ProtoMessage() {} func (*ResourceNode) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{29} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{29} } func (m *ResourceNode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -870,7 +870,7 @@ var xxx_messageInfo_ResourceNode proto.InternalMessageInfo func (m *ResourceState) Reset() { *m = ResourceState{} } func (*ResourceState) ProtoMessage() {} func (*ResourceState) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{30} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{30} } func (m *ResourceState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -895,10 +895,38 @@ func (m *ResourceState) XXX_DiscardUnknown() { var xxx_messageInfo_ResourceState proto.InternalMessageInfo +func (m *ResourceSummary) Reset() { *m = ResourceSummary{} } +func (*ResourceSummary) ProtoMessage() {} +func (*ResourceSummary) Descriptor() ([]byte, []int) { + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{31} +} +func (m *ResourceSummary) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (dst *ResourceSummary) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceSummary.Merge(dst, src) +} +func (m *ResourceSummary) XXX_Size() int { + return m.Size() +} +func (m *ResourceSummary) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceSummary.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceSummary proto.InternalMessageInfo + func (m *SyncOperation) Reset() { *m = SyncOperation{} } func (*SyncOperation) ProtoMessage() {} func (*SyncOperation) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{31} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{32} } func (m *SyncOperation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -926,7 +954,7 @@ var xxx_messageInfo_SyncOperation proto.InternalMessageInfo func (m *SyncOperationResource) Reset() { *m = SyncOperationResource{} } func (*SyncOperationResource) ProtoMessage() {} func (*SyncOperationResource) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{32} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{33} } func (m *SyncOperationResource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -954,7 +982,7 @@ var xxx_messageInfo_SyncOperationResource proto.InternalMessageInfo func (m *SyncOperationResult) Reset() { *m = SyncOperationResult{} } func (*SyncOperationResult) ProtoMessage() {} func (*SyncOperationResult) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{33} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{34} } func (m *SyncOperationResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -982,7 +1010,7 @@ var xxx_messageInfo_SyncOperationResult proto.InternalMessageInfo func (m *SyncPolicy) Reset() { *m = SyncPolicy{} } func (*SyncPolicy) ProtoMessage() {} func (*SyncPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{34} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{35} } func (m *SyncPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1010,7 +1038,7 @@ var xxx_messageInfo_SyncPolicy proto.InternalMessageInfo func (m *SyncPolicyAutomated) Reset() { *m = SyncPolicyAutomated{} } func (*SyncPolicyAutomated) ProtoMessage() {} func (*SyncPolicyAutomated) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{35} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{36} } func (m *SyncPolicyAutomated) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1038,7 +1066,7 @@ var xxx_messageInfo_SyncPolicyAutomated proto.InternalMessageInfo func (m *SyncStrategy) Reset() { *m = SyncStrategy{} } func (*SyncStrategy) ProtoMessage() {} func (*SyncStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{36} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{37} } func (m *SyncStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1066,7 +1094,7 @@ var xxx_messageInfo_SyncStrategy proto.InternalMessageInfo func (m *SyncStrategyApply) Reset() { *m = SyncStrategyApply{} } func (*SyncStrategyApply) ProtoMessage() {} func (*SyncStrategyApply) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{37} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{38} } func (m *SyncStrategyApply) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1094,7 +1122,7 @@ var xxx_messageInfo_SyncStrategyApply proto.InternalMessageInfo func (m *SyncStrategyHook) Reset() { *m = SyncStrategyHook{} } func (*SyncStrategyHook) ProtoMessage() {} func (*SyncStrategyHook) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{38} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{39} } func (m *SyncStrategyHook) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1122,7 +1150,7 @@ var xxx_messageInfo_SyncStrategyHook proto.InternalMessageInfo func (m *TLSClientConfig) Reset() { *m = TLSClientConfig{} } func (*TLSClientConfig) ProtoMessage() {} func (*TLSClientConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_generated_2886e681d51cd85f, []int{39} + return fileDescriptor_generated_bc0c401ace3cdbf9, []int{40} } func (m *TLSClientConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1179,6 +1207,7 @@ func init() { proto.RegisterType((*ResourceDetails)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ResourceDetails") proto.RegisterType((*ResourceNode)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ResourceNode") proto.RegisterType((*ResourceState)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ResourceState") + proto.RegisterType((*ResourceSummary)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ResourceSummary") proto.RegisterType((*SyncOperation)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.SyncOperation") proto.RegisterType((*SyncOperationResource)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.SyncOperationResource") proto.RegisterType((*SyncOperationResult)(nil), "github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.SyncOperationResult") @@ -1900,9 +1929,13 @@ func (m *ComparisonResult) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) i += copy(dAtA[i:], m.Status) + dAtA[i] = 0x3a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Revision))) + i += copy(dAtA[i:], m.Revision) if len(m.Resources) > 0 { for _, msg := range m.Resources { - dAtA[i] = 0x32 + dAtA[i] = 0x42 i++ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) @@ -1912,10 +1945,6 @@ func (m *ComparisonResult) MarshalTo(dAtA []byte) (int, error) { i += n } } - dAtA[i] = 0x3a - i++ - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Revision))) - i += copy(dAtA[i:], m.Revision) return i, nil } @@ -2497,6 +2526,52 @@ func (m *ResourceState) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ResourceSummary) 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 *ResourceSummary) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group))) + i += copy(dAtA[i:], m.Group) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i += copy(dAtA[i:], m.Version) + dAtA[i] = 0x1a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i += copy(dAtA[i:], m.Kind) + dAtA[i] = 0x22 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + dAtA[i] = 0x2a + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) + i += copy(dAtA[i:], m.Status) + dAtA[i] = 0x32 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(m.Health.Size())) + n33, err := m.Health.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n33 + return i, nil +} + func (m *SyncOperation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2536,21 +2611,21 @@ func (m *SyncOperation) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SyncStrategy.Size())) - n33, err := m.SyncStrategy.MarshalTo(dAtA[i:]) + n34, err := m.SyncStrategy.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n33 + i += n34 } if m.ParameterOverrides != nil { dAtA[i] = 0x2a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ParameterOverrides.Size())) - n34, err := m.ParameterOverrides.MarshalTo(dAtA[i:]) + n35, err := m.ParameterOverrides.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n34 + i += n35 } if len(m.Resources) > 0 { for _, msg := range m.Resources { @@ -2662,11 +2737,11 @@ func (m *SyncPolicy) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Automated.Size())) - n35, err := m.Automated.MarshalTo(dAtA[i:]) + n36, err := m.Automated.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n35 + i += n36 } return i, nil } @@ -2716,21 +2791,21 @@ func (m *SyncStrategy) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Apply.Size())) - n36, err := m.Apply.MarshalTo(dAtA[i:]) + n37, err := m.Apply.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n36 + i += n37 } if m.Hook != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Hook.Size())) - n37, err := m.Hook.MarshalTo(dAtA[i:]) + n38, err := m.Hook.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n37 + i += n38 } return i, nil } @@ -2779,11 +2854,11 @@ func (m *SyncStrategyHook) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.SyncStrategyApply.Size())) - n38, err := m.SyncStrategyApply.MarshalTo(dAtA[i:]) + n39, err := m.SyncStrategyApply.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n38 + i += n39 return i, nil } @@ -3107,14 +3182,14 @@ func (m *ComparisonResult) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Status) n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Revision) + n += 1 + l + sovGenerated(uint64(l)) if len(m.Resources) > 0 { for _, e := range m.Resources { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } - l = len(m.Revision) - n += 1 + l + sovGenerated(uint64(l)) return n } @@ -3343,6 +3418,24 @@ func (m *ResourceState) Size() (n int) { return n } +func (m *ResourceSummary) Size() (n int) { + var l int + _ = l + l = len(m.Group) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Name) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Status) + n += 1 + l + sovGenerated(uint64(l)) + l = m.Health.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *SyncOperation) Size() (n int) { var l int _ = l @@ -3674,8 +3767,8 @@ func (this *ComparisonResult) String() string { `ComparedAt:` + strings.Replace(strings.Replace(this.ComparedAt.String(), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, `ComparedTo:` + strings.Replace(strings.Replace(this.ComparedTo.String(), "ApplicationSource", "ApplicationSource", 1), `&`, ``, 1) + `,`, `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceState", "ResourceState", 1), `&`, ``, 1) + `,`, `Revision:` + fmt.Sprintf("%v", this.Revision) + `,`, + `Resources:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Resources), "ResourceSummary", "ResourceSummary", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -3856,6 +3949,21 @@ func (this *ResourceState) String() string { }, "") return s } +func (this *ResourceSummary) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ResourceSummary{`, + `Group:` + fmt.Sprintf("%v", this.Group) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Health:` + strings.Replace(strings.Replace(this.Health.String(), "HealthStatus", "HealthStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *SyncOperation) String() string { if this == nil { return "nil" @@ -6398,11 +6506,11 @@ func (m *ComparisonResult) Unmarshal(dAtA []byte) error { } m.Status = ComparisonStatus(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6412,28 +6520,26 @@ func (m *ComparisonResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Resources = append(m.Resources, ResourceState{}) - if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Revision = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -6443,20 +6549,22 @@ func (m *ComparisonResult) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - m.Revision = string(dAtA[iNdEx:postIndex]) + m.Resources = append(m.Resources, ResourceSummary{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -8712,6 +8820,231 @@ func (m *ResourceState) Unmarshal(dAtA []byte) error { } return nil } +func (m *ResourceSummary) 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 ErrIntOverflowGenerated + } + 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: ResourceSummary: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceSummary: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + 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 ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Group = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowGenerated + } + 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 ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + 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 ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + 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 ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + 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 ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = ComparisonStatus(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Health.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *SyncOperation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -9923,185 +10256,188 @@ var ( ) func init() { - proto.RegisterFile("github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto", fileDescriptor_generated_2886e681d51cd85f) -} - -var fileDescriptor_generated_2886e681d51cd85f = []byte{ - // 2808 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5a, 0x4d, 0x6c, 0x24, 0x47, - 0x15, 0x76, 0xcf, 0x8f, 0x3d, 0xf3, 0xc6, 0xf6, 0xee, 0x56, 0x7e, 0x18, 0x1c, 0xc9, 0xb6, 0x7a, - 0xf9, 0x09, 0x28, 0x19, 0xb3, 0x16, 0x81, 0x10, 0x10, 0x92, 0x7b, 0xbc, 0x1b, 0x3b, 0xde, 0xf5, - 0x9a, 0x1a, 0x27, 0x2b, 0x85, 0x28, 0xd0, 0xdb, 0x53, 0x9e,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f5, 0x38, 0x0b, 0x8a, 0x11, 0x7d, 0xdd, 0x08, - 0x03, 0xd0, 0x1b, 0xc6, 0xf0, 0x10, 0x63, 0x6f, 0x8a, 0xd5, 0xa0, 0x98, 0xc2, 0xdc, 0x75, 0x98, - 0x61, 0xde, 0x36, 0xe0, 0xb1, 0x91, 0xef, 0xb1, 0x08, 0x68, 0x85, 0x7e, 0x3f, 0xc8, 0x42, 0x13, - 0xff, 0x5f, 0x08, 0x16, 0xb4, 0x53, 0x80, 0x71, 0x0c, 0xe8, 0xf9, 0x71, 0x80, 0x6e, 0xfe, 0x26, - 0x07, 0x8f, 0x8c, 0x28, 0x64, 0xd1, 0x4d, 0xdd, 0x3b, 0xa2, 0xc0, 0x7b, 0x61, 0x0a, 0xe7, 0x57, - 0x66, 0x1a, 0xf1, 0x37, 0x87, 0x13, 0x07, 0x3c, 0x27, 0xcf, 0x12, 0x0e, 0xa0, 0xd8, 0xf6, 0xfd, - 0x4e, 0x3c, 0x34, 0x98, 0x24, 0x63, 0xaa, 0x56, 0xd7, 0x2a, 0x33, 0x57, 0xb3, 0x67, 0x8a, 0x85, - 0x78, 0xf3, 0x07, 0x06, 0x68, 0x37, 0x86, 0xe8, 0x5b, 0x50, 0xb6, 0xfb, 0x91, 0xdf, 0xb3, 0x23, - 0xd2, 0x94, 0x75, 0xc0, 0xee, 0x54, 0xee, 0x26, 0x37, 0x62, 0xa9, 0xc2, 0x43, 0xc9, 0x23, 0x56, - 0xfa, 0xcc, 0xe7, 0xc4, 0x8e, 0x65, 0x5e, 0x50, 0xa0, 0x61, 0x8c, 0x07, 0x0d, 0xf3, 0x1f, 0x06, - 0xa4, 0x0e, 0x2b, 0xea, 0x41, 0x91, 0x99, 0x34, 0x98, 0xc2, 0x8d, 0xb4, 0x2e, 0x77, 0x83, 0xc9, - 0x14, 0x7e, 0xe4, 0x3f, 0xb1, 0xd0, 0x82, 0x5c, 0x28, 0x30, 0x87, 0xca, 0x89, 0xe7, 0xce, 0x94, - 0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14, 0xbb, 0xf6, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x82, 0x36, 0x4b, 0xd2, 0x1b, 0x2d, 0x00, 0x00, + proto.RegisterFile("github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto", fileDescriptor_generated_bc0c401ace3cdbf9) +} + +var fileDescriptor_generated_bc0c401ace3cdbf9 = []byte{ + // 2856 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x1a, 0x5b, 0x8c, 0x1b, 0x57, + 0x75, 0xc7, 0x8f, 0x5d, 0xfb, 0x78, 0x77, 0x93, 0xdc, 0x3e, 0x30, 0x5b, 0x69, 0x77, 0x35, 0xe1, + 0x51, 0x50, 0xeb, 0x25, 0x11, 0x85, 0x52, 0x10, 0xd2, 0x8e, 0x37, 0x69, 0xb6, 0x9b, 0x6c, 0x96, + 0xeb, 0x6d, 0x23, 0x95, 0xaa, 0x30, 0x19, 0xdf, 0xb5, 0x27, 0xb6, 0x67, 0xa6, 0x73, 0xc7, 0x4e, + 0xac, 0xaa, 0x28, 0x15, 0x02, 0x81, 0x00, 0x09, 0xa8, 0x10, 0x48, 0xfc, 0x54, 0x08, 0x7e, 0xf8, + 0xae, 0xf8, 0xe0, 0x93, 0x0f, 0xd4, 0xcf, 0x0a, 0x81, 0xa8, 0x4a, 0xb5, 0xa2, 0xdb, 0x1f, 0xfe, + 0x10, 0x1f, 0xfc, 0xf4, 0x0b, 0xdd, 0xc7, 0xcc, 0xbd, 0x33, 0xb6, 0xb3, 0x9b, 0xd8, 0x09, 0xf0, + 0xe7, 0x39, 0xe7, 0xcc, 0x39, 0x67, 0xce, 0x3d, 0xef, 0x6b, 0xd8, 0x6e, 0xb9, 0x51, 0xbb, 0x7f, + 0xbd, 0xe6, 0xf8, 0xbd, 0x0d, 0x3b, 0x6c, 0xf9, 0x41, 0xe8, 0xdf, 0xe0, 0x3f, 0x9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xb1, 0x33, 0x34, 0xcb, 0xef, 0xbe, 0x58, 0xed, 0xe3, 0x52, 0xa9, 0x51, + 0xf5, 0xf1, 0xa8, 0x06, 0xec, 0x44, 0xb3, 0xd7, 0x32, 0x2c, 0x86, 0x5c, 0x8f, 0x12, 0xa7, 0x1f, + 0xc6, 0x1f, 0xaa, 0xb6, 0x3d, 0x12, 0x8e, 0x13, 0x0a, 0x74, 0x1e, 0x40, 0x5c, 0x0b, 0xee, 0xaa, + 0x31, 0x2b, 0xd9, 0x74, 0x35, 0x12, 0x0c, 0xd6, 0xa8, 0xd8, 0xa4, 0xe9, 0x90, 0x30, 0xda, 0x62, + 0xc3, 0x05, 0x4b, 0x2e, 0x8b, 0x62, 0xd2, 0xac, 0x4b, 0x18, 0x4e, 0xb0, 0xe8, 0x93, 0xb0, 0xd0, + 0x21, 0x43, 0x4e, 0x58, 0xe0, 0x84, 0x15, 0xd6, 0x23, 0xec, 0x08, 0x10, 0x8e, 0x71, 0xc8, 0x84, + 0x79, 0xc7, 0xe6, 0x54, 0x45, 0x4e, 0x05, 0xfc, 0x86, 0x70, 0x93, 0x13, 0x49, 0x8c, 0x55, 0x7b, + 0xfb, 0x83, 0xd5, 0xb9, 0x77, 0x3e, 0x58, 0x9d, 0x7b, 0xf7, 0x83, 0xd5, 0xb9, 0xdb, 0x47, 0xab, + 0xc6, 0xdb, 0x47, 0xab, 0xc6, 0x3b, 0x47, 0xab, 0xc6, 0xbb, 0x47, 0xab, 0xc6, 0xdf, 0x8f, 0x56, + 0x8d, 0x1f, 0x7f, 0xb8, 0x3a, 0xf7, 0x62, 0x29, 0x36, 0xed, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x37, 0x91, 0xeb, 0xc1, 0x72, 0x2e, 0x00, 0x00, } diff --git a/pkg/apis/application/v1alpha1/generated.proto b/pkg/apis/application/v1alpha1/generated.proto index c6205d2c5f955..8a66e580bcbb9 100644 --- a/pkg/apis/application/v1alpha1/generated.proto +++ b/pkg/apis/application/v1alpha1/generated.proto @@ -216,9 +216,9 @@ message ComparisonResult { optional string status = 5; - repeated ResourceState resources = 6; - optional string revision = 7; + + repeated ResourceSummary resources = 8; } // ComponentParameter contains information about component parameter value @@ -383,6 +383,21 @@ message ResourceState { optional HealthStatus health = 5; } +// ResourceSummary holds the resource metadata and aggregated statuses +message ResourceSummary { + optional string group = 1; + + optional string version = 2; + + optional string kind = 3; + + optional string name = 4; + + optional string status = 5; + + optional HealthStatus health = 6; +} + // SyncOperation contains sync operation details. message SyncOperation { // Revision is the git revision in which to sync the application to. diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go index 279ab81005cd2..c49a375d3d789 100644 --- a/pkg/apis/application/v1alpha1/types.go +++ b/pkg/apis/application/v1alpha1/types.go @@ -9,6 +9,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd/api" @@ -25,9 +26,8 @@ type SyncOperationResource struct { } // HasIdentity determines whether a sync operation is identified by a manifest. -func (r SyncOperationResource) HasIdentity(u *unstructured.Unstructured) bool { - gvk := u.GroupVersionKind() - if u.GetName() == r.Name && gvk.Kind == r.Kind && gvk.Group == r.Group { +func (r SyncOperationResource) HasIdentity(name string, gvk schema.GroupVersionKind) bool { + if name == r.Name && gvk.Kind == r.Kind && gvk.Group == r.Group { return true } return false @@ -347,8 +347,8 @@ type ComparisonResult struct { ComparedAt metav1.Time `json:"comparedAt" protobuf:"bytes,1,opt,name=comparedAt"` ComparedTo ApplicationSource `json:"comparedTo" protobuf:"bytes,2,opt,name=comparedTo"` Status ComparisonStatus `json:"status" protobuf:"bytes,5,opt,name=status,casttype=ComparisonStatus"` - Resources []ResourceState `json:"resources" protobuf:"bytes,6,opt,name=resources"` Revision string `json:"revision" protobuf:"bytes,7,opt,name=revision"` + Resources []ResourceSummary `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` } type HealthStatus struct { @@ -372,6 +372,20 @@ type ResourceNode struct { Children []ResourceNode `json:"children,omitempty" protobuf:"bytes,2,opt,name=children"` } +// ResourceSummary holds the resource metadata and aggregated statuses +type ResourceSummary struct { + Group string `json:"group,omitempty" protobuf:"bytes,1,opt,name=group"` + Version string `json:"version,omitempty" protobuf:"bytes,2,opt,name=version"` + Kind string `json:"kind,omitempty" protobuf:"bytes,3,opt,name=kind"` + Name string `json:"name,omitempty" protobuf:"bytes,4,opt,name=name"` + Status ComparisonStatus `json:"status,omitempty" protobuf:"bytes,5,opt,name=status"` + Health HealthStatus `json:"health,omitempty" protobuf:"bytes,6,opt,name=health"` +} + +func (r *ResourceSummary) GroupVersionKind() schema.GroupVersionKind { + return schema.GroupVersionKind{Group: r.Group, Version: r.Version, Kind: r.Kind} +} + // ResourceState holds the target state of a resource and live state of a resource type ResourceState struct { TargetState string `json:"targetState,omitempty" protobuf:"bytes,1,opt,name=targetState"` @@ -693,32 +707,6 @@ func (c *Cluster) RESTConfig() *rest.Config { } } -// TargetObjects deserializes the list of target states into unstructured objects -func (cr *ComparisonResult) TargetObjects() ([]*unstructured.Unstructured, error) { - objs := make([]*unstructured.Unstructured, len(cr.Resources)) - for i, resState := range cr.Resources { - obj, err := resState.TargetObject() - if err != nil { - return nil, err - } - objs[i] = obj - } - return objs, nil -} - -// LiveObjects deserializes the list of live states into unstructured objects -func (cr *ComparisonResult) LiveObjects() ([]*unstructured.Unstructured, error) { - objs := make([]*unstructured.Unstructured, len(cr.Resources)) - for i, resState := range cr.Resources { - obj, err := resState.LiveObject() - if err != nil { - return nil, err - } - objs[i] = obj - } - return objs, nil -} - func UnmarshalToUnstructured(resource string) (*unstructured.Unstructured, error) { if resource == "" || resource == "null" { return nil, nil diff --git a/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go index 18932f4452f70..b1a107edbfcdd 100644 --- a/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go @@ -419,10 +419,8 @@ func (in *ComparisonResult) DeepCopyInto(out *ComparisonResult) { in.ComparedTo.DeepCopyInto(&out.ComparedTo) if in.Resources != nil { in, out := &in.Resources, &out.Resources - *out = make([]ResourceState, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = make([]ResourceSummary, len(*in)) + copy(*out, *in) } return } @@ -739,6 +737,23 @@ func (in *ResourceState) DeepCopy() *ResourceState { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceSummary) DeepCopyInto(out *ResourceSummary) { + *out = *in + out.Health = in.Health + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSummary. +func (in *ResourceSummary) DeepCopy() *ResourceSummary { + if in == nil { + return nil + } + out := new(ResourceSummary) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SyncOperation) DeepCopyInto(out *SyncOperation) { *out = *in diff --git a/reposerver/repository/repository_test.go b/reposerver/repository/repository_test.go index 3176657db8b3e..7d63acec7a617 100644 --- a/reposerver/repository/repository_test.go +++ b/reposerver/repository/repository_test.go @@ -8,7 +8,7 @@ import ( func TestGenerateYamlManifestInDir(t *testing.T) { // update this value if we add/remove manifests - const countOfManifests = 22 + const countOfManifests = 23 q := ManifestRequest{} res1, err := generateManifests("../../manifests/base", &q) diff --git a/server/application/application.go b/server/application/application.go index 0a0cade9cf054..1450dbdfc24ae 100644 --- a/server/application/application.go +++ b/server/application/application.go @@ -8,6 +8,8 @@ import ( "strings" "time" + "k8s.io/apimachinery/pkg/runtime/schema" + log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc/codes" @@ -23,6 +25,7 @@ import ( "github.com/argoproj/argo-cd/common" "github.com/argoproj/argo-cd/controller" + "github.com/argoproj/argo-cd/controller/services" 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" @@ -39,16 +42,17 @@ import ( // Server provides a Application service type Server struct { - ns string - kubeclientset kubernetes.Interface - appclientset appclientset.Interface - repoClientset reposerver.Clientset - kubectl kube.Kubectl - db db.ArgoDB - appComparator controller.AppStateManager - enf *rbac.Enforcer - projectLock *util.KeyLock - auditLogger *argo.AuditLogger + ns string + kubeclientset kubernetes.Interface + appclientset appclientset.Interface + repoClientset reposerver.Clientset + controllerClientset controller.Clientset + kubectl kube.Kubectl + db db.ArgoDB + appComparator controller.AppStateManager + enf *rbac.Enforcer + projectLock *util.KeyLock + auditLogger *argo.AuditLogger } // NewServer returns a new instance of the Application service @@ -57,6 +61,7 @@ func NewServer( kubeclientset kubernetes.Interface, appclientset appclientset.Interface, repoClientset reposerver.Clientset, + controllerClientset controller.Clientset, kubectl kube.Kubectl, db db.ArgoDB, enf *rbac.Enforcer, @@ -64,16 +69,17 @@ func NewServer( ) ApplicationServiceServer { return &Server{ - ns: namespace, - appclientset: appclientset, - kubeclientset: kubeclientset, - db: db, - repoClientset: repoClientset, - kubectl: kubectl, - appComparator: controller.NewAppStateManager(db, appclientset, repoClientset, namespace, kubectl), - enf: enf, - projectLock: projectLock, - auditLogger: argo.NewAuditLogger(namespace, kubeclientset, "argocd-server"), + ns: namespace, + appclientset: appclientset, + kubeclientset: kubeclientset, + controllerClientset: controllerClientset, + db: db, + repoClientset: repoClientset, + kubectl: kubectl, + appComparator: controller.NewAppStateManager(db, appclientset, repoClientset, namespace, kubectl), + enf: enf, + projectLock: projectLock, + auditLogger: argo.NewAuditLogger(namespace, kubeclientset, "argocd-server"), } } @@ -82,65 +88,6 @@ func appRBACName(app appv1.Application) string { return fmt.Sprintf("%s/%s", app.Spec.GetProject(), app.Name) } -func toString(val interface{}) string { - if val == nil { - return "" - } - return fmt.Sprintf("%s", val) -} - -// hideSecretData checks if given object kind is Secret, replaces data keys with stars and returns unchanged data map. The method additionally check if data key if different -// from corresponding key of optional parameter `otherData` and adds extra star to keep information about difference. So if secret data is out of sync user still can see which -// fields are different. -func hideSecretData(state string, otherData map[string]interface{}) (string, map[string]interface{}) { - obj, err := appv1.UnmarshalToUnstructured(state) - if err == nil { - if obj != nil && obj.GetKind() == kube.SecretKind { - if data, ok, err := unstructured.NestedMap(obj.Object, "data"); err == nil && ok { - unchangedData := make(map[string]interface{}) - for k, v := range data { - unchangedData[k] = v - } - for k := range data { - replacement := "********" - if otherData != nil { - if val, ok := otherData[k]; ok && toString(val) != toString(data[k]) { - replacement = replacement + "*" - } - } - data[k] = replacement - } - _ = unstructured.SetNestedMap(obj.Object, data, "data") - newState, err := json.Marshal(obj) - if err == nil { - return string(newState), unchangedData - } - } - } - } - return state, nil -} - -func hideNodesSecrets(nodes []appv1.ResourceNode) { - for i := range nodes { - node := nodes[i] - node.State, _ = hideSecretData(node.State, nil) - hideNodesSecrets(node.Children) - nodes[i] = node - } -} - -func hideAppSecrets(app *appv1.Application) { - for i := range app.Status.ComparisonResult.Resources { - res := app.Status.ComparisonResult.Resources[i] - var data map[string]interface{} - res.LiveState, data = hideSecretData(res.LiveState, nil) - res.TargetState, _ = hideSecretData(res.TargetState, data) - hideNodesSecrets(res.ChildLiveResources) - app.Status.ComparisonResult.Resources[i] = res - } -} - // List returns list of applications func (s *Server) List(ctx context.Context, q *ApplicationQuery) (*appv1.ApplicationList, error) { appList, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).List(metav1.ListOptions{}) @@ -156,7 +103,6 @@ func (s *Server) List(ctx context.Context, q *ApplicationQuery) (*appv1.Applicat newItems = argoutil.FilterByProjects(newItems, q.Projects) for i := range newItems { app := newItems[i] - hideAppSecrets(&app) newItems[i] = app } appList.Items = newItems @@ -202,7 +148,6 @@ func (s *Server) Create(ctx context.Context, q *ApplicationCreateRequest) (*appv if err == nil { s.logEvent(out, ctx, argo.EventReasonResourceCreated, "created application") } - hideAppSecrets(out) return out, err } @@ -272,7 +217,6 @@ func (s *Server) Get(ctx context.Context, q *ApplicationQuery) (*appv1.Applicati return nil, err } } - hideAppSecrets(a) return a, nil } @@ -338,9 +282,6 @@ func (s *Server) Update(ctx context.Context, q *ApplicationUpdateRequest) (*appv return nil, err } out, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Update(a) - if out != nil { - hideAppSecrets(out) - } if err == nil { s.logEvent(a, ctx, argo.EventReasonResourceUpdated, "updated application") } @@ -481,7 +422,6 @@ func (s *Server) Watch(q *ApplicationQuery, ws ApplicationService_WatchServer) e // do not emit apps user does not have accessing continue } - hideAppSecrets(&a) err = ws.Send(&appv1.ApplicationWatchEvent{ Type: next.Type, Application: a, @@ -551,6 +491,15 @@ func (s *Server) ensurePodBelongsToApp(applicationName string, podName, namespac return nil } +func (s *Server) getAppResources(ctx context.Context, q *services.ResourcesQuery) (*services.ResourcesResponse, error) { + closer, client, err := s.controllerClientset.NewApplicationServiceClient() + if err != nil { + return nil, err + } + defer util.Close(closer) + return client.Resources(ctx, q) +} + func (s *Server) DeleteResource(ctx context.Context, q *ApplicationDeleteResourceRequest) (*ApplicationResponse, error) { a, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Get(*q.Name, metav1.GetOptions{}) if err != nil { @@ -559,7 +508,22 @@ func (s *Server) DeleteResource(ctx context.Context, q *ApplicationDeleteResourc if !s.enf.EnforceClaims(ctx.Value("claims"), "applications", "delete", appRBACName(*a)) { return nil, grpc.ErrPermissionDenied } - found := findResource(a, q) + + gv, err := schema.ParseGroupVersion(q.APIVersion) + if err != nil { + return nil, err + } + resources, err := s.getAppResources(ctx, &services.ResourcesQuery{ + ApplicationName: &a.Name, + Version: &gv.Version, + Group: &gv.Group, + Kind: &q.Kind, + }) + if err != nil { + return nil, err + } + + found := findResource(resources.Items, q) if found == nil { return nil, status.Errorf(codes.InvalidArgument, "%s %s %s not found as part of application %s", q.Kind, q.APIVersion, q.ResourceName, *q.Name) } @@ -575,8 +539,19 @@ func (s *Server) DeleteResource(ctx context.Context, q *ApplicationDeleteResourc return &ApplicationResponse{}, nil } -func findResource(a *appv1.Application, q *ApplicationDeleteResourceRequest) *unstructured.Unstructured { - for _, res := range a.Status.ComparisonResult.Resources { +func (s *Server) Resources(ctx context.Context, q *services.ResourcesQuery) (*services.ResourcesResponse, error) { + a, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Get(*q.ApplicationName, metav1.GetOptions{}) + if err != nil { + return nil, err + } + if !s.enf.EnforceClaims(ctx.Value("claims"), "applications", "get", appRBACName(*a)) { + return nil, grpc.ErrPermissionDenied + } + return s.getAppResources(ctx, q) +} + +func findResource(resources []*appv1.ResourceState, q *ApplicationDeleteResourceRequest) *unstructured.Unstructured { + for _, res := range resources { liveObj, err := res.LiveObject() if err != nil { log.Warnf("Failed to unmarshal live object: %v", err) @@ -752,7 +727,7 @@ func (s *Server) Sync(ctx context.Context, syncReq *ApplicationSyncRequest) (*ap Resources: syncReq.Resources, }, } - a, err = argo.SetAppOperation(ctx, appIf, s.auditLogger, *syncReq.Name, &op) + a, err = argo.SetAppOperation(appIf, *syncReq.Name, &op) if err == nil { rev := syncReq.Revision if syncReq.Revision == "" { @@ -797,7 +772,7 @@ func (s *Server) Rollback(ctx context.Context, rollbackReq *ApplicationRollbackR ParameterOverrides: deploymentInfo.ComponentParameterOverrides, }, } - a, err = argo.SetAppOperation(ctx, appIf, s.auditLogger, *rollbackReq.Name, &op) + a, err = argo.SetAppOperation(appIf, *rollbackReq.Name, &op) if err == nil { s.logEvent(a, ctx, argo.EventReasonOperationStarted, fmt.Sprintf("initiated rollback to %d", rollbackReq.ID)) } diff --git a/server/application/application.pb.go b/server/application/application.pb.go index eee0e2c5e6677..655e3fcc5abdb 100644 --- a/server/application/application.pb.go +++ b/server/application/application.pb.go @@ -12,6 +12,7 @@ package application // import "github.com/argoproj/argo-cd/server/application" import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import services "github.com/argoproj/argo-cd/controller/services" import v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" import repository "github.com/argoproj/argo-cd/reposerver/repository" import _ "github.com/gogo/protobuf/gogoproto" @@ -51,7 +52,7 @@ func (m *ApplicationQuery) Reset() { *m = ApplicationQuery{} } func (m *ApplicationQuery) String() string { return proto.CompactTextString(m) } func (*ApplicationQuery) ProtoMessage() {} func (*ApplicationQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{0} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{0} } func (m *ApplicationQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,7 +116,7 @@ func (m *ApplicationResourceEventsQuery) Reset() { *m = ApplicationResou func (m *ApplicationResourceEventsQuery) String() string { return proto.CompactTextString(m) } func (*ApplicationResourceEventsQuery) ProtoMessage() {} func (*ApplicationResourceEventsQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{1} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{1} } func (m *ApplicationResourceEventsQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -178,7 +179,7 @@ func (m *ApplicationManifestQuery) Reset() { *m = ApplicationManifestQue func (m *ApplicationManifestQuery) String() string { return proto.CompactTextString(m) } func (*ApplicationManifestQuery) ProtoMessage() {} func (*ApplicationManifestQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{2} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{2} } func (m *ApplicationManifestQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,7 +232,7 @@ func (m *ApplicationResponse) Reset() { *m = ApplicationResponse{} } func (m *ApplicationResponse) String() string { return proto.CompactTextString(m) } func (*ApplicationResponse) ProtoMessage() {} func (*ApplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{3} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{3} } func (m *ApplicationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -272,7 +273,7 @@ func (m *ApplicationCreateRequest) Reset() { *m = ApplicationCreateReque func (m *ApplicationCreateRequest) String() string { return proto.CompactTextString(m) } func (*ApplicationCreateRequest) ProtoMessage() {} func (*ApplicationCreateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{4} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{4} } func (m *ApplicationCreateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -326,7 +327,7 @@ func (m *ApplicationUpdateRequest) Reset() { *m = ApplicationUpdateReque func (m *ApplicationUpdateRequest) String() string { return proto.CompactTextString(m) } func (*ApplicationUpdateRequest) ProtoMessage() {} func (*ApplicationUpdateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{5} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{5} } func (m *ApplicationUpdateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -374,7 +375,7 @@ func (m *ApplicationDeleteRequest) Reset() { *m = ApplicationDeleteReque func (m *ApplicationDeleteRequest) String() string { return proto.CompactTextString(m) } func (*ApplicationDeleteRequest) ProtoMessage() {} func (*ApplicationDeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{6} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{6} } func (m *ApplicationDeleteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -435,7 +436,7 @@ func (m *ApplicationSyncRequest) Reset() { *m = ApplicationSyncRequest{} func (m *ApplicationSyncRequest) String() string { return proto.CompactTextString(m) } func (*ApplicationSyncRequest) ProtoMessage() {} func (*ApplicationSyncRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{7} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{7} } func (m *ApplicationSyncRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,7 +527,7 @@ func (m *ParameterOverrides) Reset() { *m = ParameterOverrides{} } func (m *ParameterOverrides) String() string { return proto.CompactTextString(m) } func (*ParameterOverrides) ProtoMessage() {} func (*ParameterOverrides) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{8} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{8} } func (m *ParameterOverrides) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -575,7 +576,7 @@ func (m *Parameter) Reset() { *m = Parameter{} } func (m *Parameter) String() string { return proto.CompactTextString(m) } func (*Parameter) ProtoMessage() {} func (*Parameter) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{9} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{9} } func (m *Parameter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -638,7 +639,7 @@ func (m *ApplicationUpdateSpecRequest) Reset() { *m = ApplicationUpdateS func (m *ApplicationUpdateSpecRequest) String() string { return proto.CompactTextString(m) } func (*ApplicationUpdateSpecRequest) ProtoMessage() {} func (*ApplicationUpdateSpecRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{10} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{10} } func (m *ApplicationUpdateSpecRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -695,7 +696,7 @@ func (m *ApplicationRollbackRequest) Reset() { *m = ApplicationRollbackR func (m *ApplicationRollbackRequest) String() string { return proto.CompactTextString(m) } func (*ApplicationRollbackRequest) ProtoMessage() {} func (*ApplicationRollbackRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{11} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{11} } func (m *ApplicationRollbackRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -766,7 +767,7 @@ func (m *ApplicationDeleteResourceRequest) Reset() { *m = ApplicationDel func (m *ApplicationDeleteResourceRequest) String() string { return proto.CompactTextString(m) } func (*ApplicationDeleteResourceRequest) ProtoMessage() {} func (*ApplicationDeleteResourceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{12} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{12} } func (m *ApplicationDeleteResourceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -840,7 +841,7 @@ func (m *ApplicationPodLogsQuery) Reset() { *m = ApplicationPodLogsQuery func (m *ApplicationPodLogsQuery) String() string { return proto.CompactTextString(m) } func (*ApplicationPodLogsQuery) ProtoMessage() {} func (*ApplicationPodLogsQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{13} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{13} } func (m *ApplicationPodLogsQuery) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -930,7 +931,7 @@ func (m *LogEntry) Reset() { *m = LogEntry{} } func (m *LogEntry) String() string { return proto.CompactTextString(m) } func (*LogEntry) ProtoMessage() {} func (*LogEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{14} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{14} } func (m *LogEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -984,7 +985,7 @@ func (m *OperationTerminateRequest) Reset() { *m = OperationTerminateReq func (m *OperationTerminateRequest) String() string { return proto.CompactTextString(m) } func (*OperationTerminateRequest) ProtoMessage() {} func (*OperationTerminateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{15} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{15} } func (m *OperationTerminateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1030,7 +1031,7 @@ func (m *OperationTerminateResponse) Reset() { *m = OperationTerminateRe func (m *OperationTerminateResponse) String() string { return proto.CompactTextString(m) } func (*OperationTerminateResponse) ProtoMessage() {} func (*OperationTerminateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_application_29e2d383e1dc72bd, []int{16} + return fileDescriptor_application_bd7d6e09af32e4fb, []int{16} } func (m *OperationTerminateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1110,6 +1111,7 @@ type ApplicationServiceClient interface { Delete(ctx context.Context, in *ApplicationDeleteRequest, opts ...grpc.CallOption) (*ApplicationResponse, error) // Sync syncs an application to its target state Sync(ctx context.Context, in *ApplicationSyncRequest, opts ...grpc.CallOption) (*v1alpha1.Application, error) + Resources(ctx context.Context, in *services.ResourcesQuery, opts ...grpc.CallOption) (*services.ResourcesResponse, error) // Rollback syncs an application to its target state Rollback(ctx context.Context, in *ApplicationRollbackRequest, opts ...grpc.CallOption) (*v1alpha1.Application, error) // TerminateOperation terminates the currently running operation @@ -1241,6 +1243,15 @@ func (c *applicationServiceClient) Sync(ctx context.Context, in *ApplicationSync return out, nil } +func (c *applicationServiceClient) Resources(ctx context.Context, in *services.ResourcesQuery, opts ...grpc.CallOption) (*services.ResourcesResponse, error) { + out := new(services.ResourcesResponse) + err := c.cc.Invoke(ctx, "/application.ApplicationService/Resources", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *applicationServiceClient) Rollback(ctx context.Context, in *ApplicationRollbackRequest, opts ...grpc.CallOption) (*v1alpha1.Application, error) { out := new(v1alpha1.Application) err := c.cc.Invoke(ctx, "/application.ApplicationService/Rollback", in, out, opts...) @@ -1323,6 +1334,7 @@ type ApplicationServiceServer interface { Delete(context.Context, *ApplicationDeleteRequest) (*ApplicationResponse, error) // Sync syncs an application to its target state Sync(context.Context, *ApplicationSyncRequest) (*v1alpha1.Application, error) + Resources(context.Context, *services.ResourcesQuery) (*services.ResourcesResponse, error) // Rollback syncs an application to its target state Rollback(context.Context, *ApplicationRollbackRequest) (*v1alpha1.Application, error) // TerminateOperation terminates the currently running operation @@ -1520,6 +1532,24 @@ func _ApplicationService_Sync_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ApplicationService_Resources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(services.ResourcesQuery) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ApplicationServiceServer).Resources(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/application.ApplicationService/Resources", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ApplicationServiceServer).Resources(ctx, req.(*services.ResourcesQuery)) + } + return interceptor(ctx, in, info, handler) +} + func _ApplicationService_Rollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ApplicationRollbackRequest) if err := dec(in); err != nil { @@ -1635,6 +1665,10 @@ var _ApplicationService_serviceDesc = grpc.ServiceDesc{ MethodName: "Sync", Handler: _ApplicationService_Sync_Handler, }, + { + MethodName: "Resources", + Handler: _ApplicationService_Resources_Handler, + }, { MethodName: "Rollback", Handler: _ApplicationService_Rollback_Handler, @@ -4934,99 +4968,102 @@ var ( ) func init() { - proto.RegisterFile("server/application/application.proto", fileDescriptor_application_29e2d383e1dc72bd) -} - -var fileDescriptor_application_29e2d383e1dc72bd = []byte{ - // 1427 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0x66, 0xec, 0xc4, 0x8e, 0x5f, 0x2a, 0x04, 0x43, 0x1b, 0x96, 0x25, 0x4d, 0xac, 0x6d, 0x9a, - 0xba, 0x29, 0xdd, 0x6d, 0xa2, 0x4a, 0xa0, 0x0a, 0x84, 0x1a, 0x5a, 0xda, 0x54, 0xa1, 0x35, 0x9b, - 0x16, 0x24, 0x2e, 0x68, 0xba, 0x3b, 0x75, 0x96, 0xd8, 0x3b, 0xcb, 0xec, 0xd8, 0xc8, 0x54, 0x3d, - 0x50, 0x10, 0x27, 0xa4, 0x0a, 0xc1, 0x81, 0x1b, 0xd0, 0x33, 0xe2, 0xc2, 0x9d, 0x73, 0x8f, 0x48, - 0xdc, 0x2b, 0x14, 0xf1, 0x87, 0xa0, 0x99, 0xdd, 0xf5, 0xce, 0x36, 0xf6, 0xa6, 0x50, 0x73, 0x9b, - 0x7d, 0xf3, 0xe6, 0xbd, 0xef, 0xfd, 0x9a, 0xf9, 0x6c, 0x58, 0x89, 0x29, 0x1f, 0x50, 0xee, 0x90, - 0x28, 0xea, 0x06, 0x1e, 0x11, 0x01, 0x0b, 0xf5, 0xb5, 0x1d, 0x71, 0x26, 0x18, 0x9e, 0xd7, 0x44, - 0xe6, 0xd1, 0x0e, 0xeb, 0x30, 0x25, 0x77, 0xe4, 0x2a, 0x51, 0x31, 0x17, 0x3b, 0x8c, 0x75, 0xba, - 0xd4, 0x21, 0x51, 0xe0, 0x90, 0x30, 0x64, 0x42, 0x29, 0xc7, 0xe9, 0xae, 0xb5, 0xf7, 0x46, 0x6c, - 0x07, 0x4c, 0xed, 0x7a, 0x8c, 0x53, 0x67, 0xb0, 0xee, 0x74, 0x68, 0x48, 0x39, 0x11, 0xd4, 0x4f, - 0x75, 0xce, 0xe7, 0x3a, 0x3d, 0xe2, 0xed, 0x06, 0x21, 0xe5, 0x43, 0x27, 0xda, 0xeb, 0x48, 0x41, - 0xec, 0xf4, 0xa8, 0x20, 0xe3, 0x4e, 0x6d, 0x75, 0x02, 0xb1, 0xdb, 0xbf, 0x6d, 0x7b, 0xac, 0xe7, - 0x10, 0xae, 0x80, 0x7d, 0xa2, 0x16, 0x67, 0x3d, 0x3f, 0x3f, 0xad, 0x87, 0x37, 0x58, 0x27, 0xdd, - 0x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x0e, 0xd5, 0x2b, 0xce, 0xf5, 0x5a, 0xe9, 0x5c, 0xb3, 0x91, 0xff, 0x07, 0x08, 0x9e, - 0x2f, 0x92, 0x40, 0x7c, 0xf6, 0xb0, 0x4e, 0x2b, 0x90, 0xc5, 0xa7, 0xe8, 0xb8, 0xd7, 0x14, 0xa4, - 0xd5, 0xb5, 0xf2, 0x5c, 0x65, 0xee, 0xbf, 0x40, 0x50, 0x4f, 0x59, 0x1e, 0x5e, 0x99, 0x64, 0x5b, - 0xa7, 0x81, 0xe6, 0xb1, 0x82, 0x56, 0xc6, 0x84, 0xac, 0xd7, 0x95, 0xdb, 0x75, 0xec, 0x94, 0xb9, - 0x8d, 0x98, 0x1f, 0x3b, 0x77, 0x53, 0x8a, 0x78, 0xcf, 0xe9, 0xb2, 0x4e, 0x7c, 0x0e, 0x6d, 0xbe, - 0xf9, 0x68, 0x7f, 0x09, 0xfd, 0xb1, 0xbf, 0x84, 0xfe, 0xda, 0x5f, 0x42, 0x1f, 0xd9, 0x65, 0xff, - 0xe5, 0x1c, 0xfc, 0xcf, 0xeb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x08, 0x8a, 0xbf, 0x08, - 0x13, 0x00, 0x00, + proto.RegisterFile("server/application/application.proto", fileDescriptor_application_bd7d6e09af32e4fb) +} + +var fileDescriptor_application_bd7d6e09af32e4fb = []byte{ + // 1488 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6f, 0x1c, 0x45, + 0x16, 0xdf, 0x9a, 0xf1, 0xd7, 0x3c, 0x47, 0xab, 0x55, 0x6d, 0xe2, 0xed, 0x6d, 0x1c, 0x7b, 0xd4, + 0x71, 0x1c, 0xc7, 0x21, 0xdd, 0xb1, 0x15, 0x89, 0x28, 0x02, 0x45, 0x31, 0x09, 0x89, 0x23, 0x93, + 0x98, 0x71, 0x02, 0x12,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c, 0x1b, 0xff, 0x84, 0x60, 0x26, 0x23, 0x85, 0xf8, 0xd4, 0xc8, 0x1a, 0x96, 0x69, 0xe3, + 0xd8, 0xf2, 0xee, 0x69, 0xdc, 0xa7, 0x9d, 0xa5, 0xaa, 0xbc, 0xf3, 0xd4, 0xb9, 0xca, 0xfd, 0xb7, + 0x08, 0x70, 0xfe, 0x76, 0xe7, 0xaf, 0x39, 0x5e, 0x2e, 0xb9, 0x1a, 0x49, 0x0b, 0xec, 0x53, 0x87, + 0xea, 0x95, 0x2f, 0xa9, 0xd5, 0xca, 0x4b, 0x8a, 0xe5, 0xfe, 0x1f, 0x21, 0xf8, 0x77, 0x99, 0xd1, + 0xe2, 0xb3, 0x87, 0x8d, 0x4d, 0x89, 0xf9, 0xbe, 0xc0, 0xf8, 0xbc, 0xae, 0x21, 0x2d, 0xaf, 0x56, + 0xe7, 0x2a, 0x73, 0xff, 0x39, 0x82, 0xe9, 0x94, 0xb2, 0xe2, 0xa5, 0x51, 0xb6, 0x4d, 0x4e, 0x6b, + 0x1f, 0x2b, 0x69, 0x65, 0xb4, 0xce, 0x79, 0x43, 0xbb, 0x5d, 0xc3, 0x5e, 0x95, 0xdb, 0x98, 0x05, + 0xc2, 0xbb, 0x9f, 0xf2, 0xdd, 0x07, 0x5e, 0x87, 0xb5, 0xc5, 0x39, 0xb4, 0xf1, 0xe6, 0x93, 0xfd, + 0x05, 0xf4, 0x74, 0x7f, 0x01, 0xfd, 0xb1, 0xbf, 0x80, 0x3e, 0x74, 0xab, 0xfe, 0x97, 0x3a, 0xf8, + 0x1f, 0xe0, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08, 0x74, 0xdb, 0xa0, 0x18, 0x14, 0x00, 0x00, } diff --git a/server/application/application.pb.gw.go b/server/application/application.pb.gw.go index cc744af83bac2..0f9db6ba78b9e 100644 --- a/server/application/application.pb.gw.go +++ b/server/application/application.pb.gw.go @@ -12,6 +12,7 @@ import ( "io" "net/http" + "github.com/argoproj/argo-cd/controller/services" "github.com/golang/protobuf/proto" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/grpc-ecosystem/grpc-gateway/utilities" @@ -324,6 +325,41 @@ func request_ApplicationService_Sync_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_ApplicationService_Resources_0 = &utilities.DoubleArray{Encoding: map[string]int{"applicationName": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_ApplicationService_Resources_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq services.ResourcesQuery + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["applicationName"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "applicationName") + } + + protoReq.ApplicationName, err = runtime.StringP(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "applicationName", err) + } + + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ApplicationService_Resources_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Resources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + 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 @@ -799,6 +835,35 @@ func RegisterApplicationServiceHandlerClient(ctx context.Context, mux *runtime.S }) + mux.Handle("GET", pattern_ApplicationService_Resources_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_Resources_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_Resources_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + 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() @@ -939,6 +1004,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_Resources_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", "applicationName", "resources"}, "")) + 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_TerminateOperation_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", "operation"}, "")) @@ -969,6 +1036,8 @@ var ( forward_ApplicationService_Sync_0 = runtime.ForwardResponseMessage + forward_ApplicationService_Resources_0 = runtime.ForwardResponseMessage + forward_ApplicationService_Rollback_0 = runtime.ForwardResponseMessage forward_ApplicationService_TerminateOperation_0 = runtime.ForwardResponseMessage diff --git a/server/application/application.proto b/server/application/application.proto index 7bf7524ed0a91..c1f36148afc3f 100644 --- a/server/application/application.proto +++ b/server/application/application.proto @@ -12,6 +12,7 @@ import "k8s.io/api/core/v1/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto"; import "github.com/argoproj/argo-cd/reposerver/repository/repository.proto"; +import "github.com/argoproj/argo-cd/controller/services/application.proto"; // ApplicationQuery is a query for application resources @@ -180,6 +181,10 @@ service ApplicationService { }; } + rpc Resources(github.com.argoproj.argo_cd.controller.services.ResourcesQuery) returns (github.com.argoproj.argo_cd.controller.services.ResourcesResponse) { + option (google.api.http).get = "/api/v1/applications/{applicationName}/resources"; + } + // Rollback syncs an application to its target state rpc Rollback(ApplicationRollbackRequest) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) { option (google.api.http) = { diff --git a/server/application/application_test.go b/server/application/application_test.go index 4115c54468c2c..0545b52e230e6 100644 --- a/server/application/application_test.go +++ b/server/application/application_test.go @@ -1,9 +1,10 @@ package application import ( - "golang.org/x/net/context" "testing" + "golang.org/x/net/context" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" @@ -123,6 +124,7 @@ func newTestAppServer() ApplicationServiceServer { kubeclientset, apps.NewSimpleClientset(defaultProj), mockRepoClient, + nil, kube.KubectlCmd{}, db, enforcer, diff --git a/server/server.go b/server/server.go index 5c3fcdd01657a..364574199ba10 100644 --- a/server/server.go +++ b/server/server.go @@ -36,6 +36,7 @@ import ( "github.com/argoproj/argo-cd" "github.com/argoproj/argo-cd/common" + "github.com/argoproj/argo-cd/controller" "github.com/argoproj/argo-cd/errors" "github.com/argoproj/argo-cd/pkg/apiclient" "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1" @@ -121,15 +122,16 @@ type ArgoCDServer struct { } type ArgoCDServerOpts struct { - DisableAuth bool - Insecure bool - Namespace string - DexServerAddr string - StaticAssetsDir string - KubeClientset kubernetes.Interface - AppClientset appclientset.Interface - RepoClientset reposerver.Clientset - TLSConfigCustomizer tlsutil.ConfigCustomizer + DisableAuth bool + Insecure bool + Namespace string + DexServerAddr string + StaticAssetsDir string + KubeClientset kubernetes.Interface + AppClientset appclientset.Interface + RepoClientset reposerver.Clientset + AppControllerClientset controller.Clientset + TLSConfigCustomizer tlsutil.ConfigCustomizer } // initializeDefaultProject creates the default project if it does not already exist @@ -421,7 +423,7 @@ func (a *ArgoCDServer) newGRPCServer() *grpc.Server { repoService := repository.NewServer(a.RepoClientset, db, a.enf, argocache.NewInMemoryCache(repository.DefaultRepoStatusCacheExpiration)) sessionService := session.NewServer(a.sessionMgr) projectLock := util.NewKeyLock() - applicationService := application.NewServer(a.Namespace, a.KubeClientset, a.AppClientset, a.RepoClientset, kube.KubectlCmd{}, db, a.enf, projectLock) + applicationService := application.NewServer(a.Namespace, a.KubeClientset, a.AppClientset, a.RepoClientset, a.AppControllerClientset, kube.KubectlCmd{}, db, a.enf, projectLock) projectService := project.NewServer(a.Namespace, a.KubeClientset, a.AppClientset, a.enf, projectLock, a.sessionMgr) settingsService := settings.NewServer(a.settingsMgr) accountService := account.NewServer(a.sessionMgr, a.settingsMgr) diff --git a/server/swagger.json b/server/swagger.json index 8306734e54aaf..9af7bfb72cd0e 100644 --- a/server/swagger.json +++ b/server/swagger.json @@ -139,6 +139,45 @@ } } }, + "/api/v1/applications/{applicationName}/resources": { + "get": { + "tags": [ + "ApplicationService" + ], + "operationId": "Resources", + "parameters": [ + { + "type": "string", + "name": "applicationName", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "group", + "in": "query" + }, + { + "type": "string", + "name": "version", + "in": "query" + }, + { + "type": "string", + "name": "kind", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/servicesResourcesResponse" + } + } + } + } + }, "/api/v1/applications/{name}": { "get": { "tags": [ @@ -1552,6 +1591,17 @@ "repositoryRepoResponse": { "type": "object" }, + "servicesResourcesResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceState" + } + } + } + }, "sessionSessionCreateRequest": { "description": "SessionCreateRequest is for logging in.", "type": "object", @@ -2321,7 +2371,7 @@ "resources": { "type": "array", "items": { - "$ref": "#/definitions/v1alpha1ResourceState" + "$ref": "#/definitions/v1alpha1ResourceSummary" } }, "revision": { @@ -2594,6 +2644,30 @@ } } }, + "v1alpha1ResourceSummary": { + "type": "object", + "title": "ResourceSummary holds the resource metadata and aggregated statuses", + "properties": { + "group": { + "type": "string" + }, + "health": { + "$ref": "#/definitions/v1alpha1HealthStatus" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, "v1alpha1SyncOperation": { "description": "SyncOperation contains sync operation details.", "type": "object", diff --git a/test/e2e/app_management_test.go b/test/e2e/app_management_test.go index 7e00eb6c25d32..ff1cbd6d1fad3 100644 --- a/test/e2e/app_management_test.go +++ b/test/e2e/app_management_test.go @@ -99,10 +99,6 @@ func TestAppManagement(t *testing.T) { t.Run("TestTrackAppStateAndSyncApp", func(t *testing.T) { app := fixture.CreateApp(t, testApp) - WaitUntil(t, func() (done bool, err error) { - app, err = fixture.AppClient.ArgoprojV1alpha1().Applications(fixture.Namespace).Get(app.ObjectMeta.Name, metav1.GetOptions{}) - return err == nil && app.Status.ComparisonResult.Status != v1alpha1.ComparisonStatusUnknown, err - }) // sync app and make sure it reaches InSync state _, err := fixture.RunCli("app", "sync", app.Name) @@ -139,11 +135,6 @@ func TestAppManagement(t *testing.T) { t.Fatalf("Unable to update app %v", err) } - WaitUntil(t, func() (done bool, err error) { - app, err = fixture.AppClient.ArgoprojV1alpha1().Applications(fixture.Namespace).Get(app.ObjectMeta.Name, metav1.GetOptions{}) - return err == nil && app.Status.ComparisonResult.Status != v1alpha1.ComparisonStatusUnknown, err - }) - // sync app and make sure it reaches InSync state _, err = fixture.RunCli("app", "rollback", app.Name, "1") if err != nil { diff --git a/test/e2e/fixture.go b/test/e2e/fixture.go index 0e3f025ac1095..977c585a8a8a4 100644 --- a/test/e2e/fixture.go +++ b/test/e2e/fixture.go @@ -51,15 +51,16 @@ const ( // Fixture represents e2e tests fixture. type Fixture struct { - Config *rest.Config - KubeClient kubernetes.Interface - ExtensionsClient apiextensionsclient.Interface - AppClient appclientset.Interface - DB db.ArgoDB - Namespace string - RepoServerAddress string - ApiServerAddress string - Enforcer *rbac.Enforcer + Config *rest.Config + KubeClient kubernetes.Interface + ExtensionsClient apiextensionsclient.Interface + AppClient appclientset.Interface + DB db.ArgoDB + Namespace string + RepoServerAddress string + ApiServerAddress string + ControllerServerAddress string + Enforcer *rbac.Enforcer tearDownCallback func() } @@ -120,31 +121,40 @@ func (f *Fixture) setup() error { return err } + repoServerPort, err := getFreePort() + if err != nil { + return err + } + apiServerPort, err := getFreePort() if err != nil { return err } - memCache := cache.NewInMemoryCache(repository.DefaultRepoCacheExpiration) - repoSrv, err := reposerver.NewServer(&FakeGitClientFactory{}, memCache, func(config *tls.Config) {}) + controllerServerPort, err := getFreePort() if err != nil { return err } - repoServerGRPC := repoSrv.CreateGRPC() - repoServerListener, err := net.Listen("tcp", "127.0.0.1:0") + + memCache := cache.NewInMemoryCache(repository.DefaultRepoCacheExpiration) + repoSrv, err := reposerver.NewServer(&FakeGitClientFactory{}, memCache, func(config *tls.Config) {}) if err != nil { return err } - f.RepoServerAddress = repoServerListener.Addr().String() + repoServerGRPC := repoSrv.CreateGRPC() + + f.RepoServerAddress = fmt.Sprintf("127.0.0.1:%d", repoServerPort) f.ApiServerAddress = fmt.Sprintf("127.0.0.1:%d", apiServerPort) + f.ControllerServerAddress = fmt.Sprintf("127.0.0.1:%d", controllerServerPort) apiServer := server.NewServer(server.ArgoCDServerOpts{ - Namespace: f.Namespace, - AppClientset: f.AppClient, - DisableAuth: true, - Insecure: true, - KubeClientset: f.KubeClient, - RepoClientset: reposerver.NewRepositoryServerClientset(f.RepoServerAddress), + Namespace: f.Namespace, + AppClientset: f.AppClient, + DisableAuth: true, + Insecure: true, + KubeClientset: f.KubeClient, + RepoClientset: reposerver.NewRepositoryServerClientset(f.RepoServerAddress), + AppControllerClientset: controller.NewAppControllerClientset(f.ControllerServerAddress), }) ctx, cancel := context.WithCancel(context.Background()) @@ -166,18 +176,40 @@ func (f *Fixture) setup() error { return err == nil, nil }) + if err != nil { + cancel() + return err + } + ctrl := f.createController() + controllerServerGRPC, err := ctrl.CreateGRPC(func(config *tls.Config) {}) + if err != nil { + cancel() + return err + } ctrlCtx, cancelCtrl := context.WithCancel(context.Background()) go ctrl.Run(ctrlCtx, 1, 1) + go func() { + var listener net.Listener + listener, err = net.Listen("tcp", f.ControllerServerAddress) + if err == nil { + err = controllerServerGRPC.Serve(listener) + } + }() go func() { - err = repoServerGRPC.Serve(repoServerListener) + var listener net.Listener + listener, err = net.Listen("tcp", f.RepoServerAddress) + if err == nil { + err = repoServerGRPC.Serve(listener) + } }() f.tearDownCallback = func() { cancel() cancelCtrl() repoServerGRPC.Stop() + controllerServerGRPC.Stop() } return err diff --git a/util/argo/argo.go b/util/argo/argo.go index 56d4ec64a18e9..ed7245594ffe3 100644 --- a/util/argo/argo.go +++ b/util/argo/argo.go @@ -9,12 +9,13 @@ import ( "strings" "time" + "k8s.io/apimachinery/pkg/runtime/schema" + log "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" 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/fields" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" @@ -439,7 +440,7 @@ func verifyGenerateManifests(ctx context.Context, repoRes *argoappv1.Repository, } // SetAppOperation updates an application with the specified operation, retrying conflict errors -func SetAppOperation(ctx context.Context, appIf v1alpha1.ApplicationInterface, audit *AuditLogger, appName string, op *argoappv1.Operation) (*argoappv1.Application, error) { +func SetAppOperation(appIf v1alpha1.ApplicationInterface, appName string, op *argoappv1.Operation) (*argoappv1.Application, error) { for { a, err := appIf.Get(appName, metav1.GetOptions{}) if err != nil { @@ -465,14 +466,9 @@ func SetAppOperation(ctx context.Context, appIf v1alpha1.ApplicationInterface, a } // ContainsSyncResource determines if the given resource exists in the provided slice of sync operation resources. -// ContainsSyncResource returns false if either argument is nil. -func ContainsSyncResource(u *unstructured.Unstructured, rr []argoappv1.SyncOperationResource) bool { - if u == nil || rr == nil { - return false - } - +func ContainsSyncResource(name string, gvk schema.GroupVersionKind, rr []argoappv1.SyncOperationResource) bool { for _, r := range rr { - if r.HasIdentity(u) { + if r.HasIdentity(name, gvk) { return true } } diff --git a/util/argo/argo_test.go b/util/argo/argo_test.go index 3241cb954c73f..c1282fdb295d0 100644 --- a/util/argo/argo_test.go +++ b/util/argo/argo_test.go @@ -100,22 +100,20 @@ func TestContainsSyncResource(t *testing.T) { var ( blankUnstructured unstructured.Unstructured blankResource argoappv1.SyncOperationResource - helloResource argoappv1.SyncOperationResource = argoappv1.SyncOperationResource{Name: "hello"} + helloResource = argoappv1.SyncOperationResource{Name: "hello"} ) tables := []struct { u *unstructured.Unstructured rr []argoappv1.SyncOperationResource expected bool }{ - {nil, nil, false}, - {nil, []argoappv1.SyncOperationResource{}, false}, {&blankUnstructured, []argoappv1.SyncOperationResource{}, false}, {&blankUnstructured, []argoappv1.SyncOperationResource{blankResource}, true}, {&blankUnstructured, []argoappv1.SyncOperationResource{helloResource}, false}, } for _, table := range tables { - if out := ContainsSyncResource(table.u, table.rr); out != table.expected { + if out := ContainsSyncResource(table.u.GetName(), table.u.GroupVersionKind(), table.rr); out != table.expected { t.Errorf("Expected %t for slice %+v conains resource %+v; instead got %t", table.expected, table.rr, table.u, out) } }