mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-04-10 10:48:46 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e470aaf09 | ||
|
|
76922b620b | ||
|
|
ac0f623eda | ||
|
|
afd5450882 | ||
|
|
c17266fc21 | ||
|
|
f62c825495 | ||
|
|
45f44dd4be |
14
CHANGELOG.md
Normal file
14
CHANGELOG.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## v0.4.0 (2018-05-17)
|
||||
+ SSO Integration
|
||||
+ GitHub Webhook
|
||||
+ Add application health status
|
||||
+ Sync/Rollback/Delete is asynchronously handled by controller
|
||||
* Refactor CRUD operation on clusters and repos
|
||||
* Sync will always perform kubectl apply
|
||||
* Synced Status considers last-applied-configuration annotatoin
|
||||
* Server & namespace are mandatory fields (still inferred from app.yaml)
|
||||
* Manifests are memoized in repo server
|
||||
- Fix connection timeouts to SSH repos
|
||||
|
||||
@@ -43,6 +43,7 @@ func NewApplicationCommand(clientOpts *argocdclient.ClientOptions) *cobra.Comman
|
||||
command.AddCommand(NewApplicationRollbackCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationListCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationDeleteCommand(clientOpts))
|
||||
command.AddCommand(NewApplicationWaitCommand(clientOpts))
|
||||
return command
|
||||
}
|
||||
|
||||
@@ -122,23 +123,21 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
}
|
||||
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
|
||||
acdClient := argocdclient.NewClientOrDie(clientOpts)
|
||||
conn, appIf := acdClient.NewApplicationClientOrDie()
|
||||
defer util.Close(conn)
|
||||
appName := args[0]
|
||||
app, err := appIf.Get(context.Background(), &application.ApplicationQuery{Name: &appName})
|
||||
errors.CheckError(err)
|
||||
format := "%-15s%s\n"
|
||||
fmt.Printf(format, "Name:", app.Name)
|
||||
fmt.Printf(format, "Environment:", app.Spec.Source.Environment)
|
||||
fmt.Printf(format, "Server:", app.Spec.Destination.Server)
|
||||
fmt.Printf(format, "Namespace:", app.Spec.Destination.Namespace)
|
||||
fmt.Printf(format, "URL:", appURL(acdClient, app))
|
||||
fmt.Printf(format, "Environment:", app.Spec.Source.Environment)
|
||||
fmt.Printf(format, "Repo:", app.Spec.Source.RepoURL)
|
||||
fmt.Printf(format, "Path:", app.Spec.Source.Path)
|
||||
if app.Spec.Source.TargetRevision == "" {
|
||||
fmt.Printf(format, "Target:", "HEAD")
|
||||
} else {
|
||||
fmt.Printf(format, "Target:", app.Spec.Source.TargetRevision)
|
||||
}
|
||||
fmt.Printf(format, "Target:", app.Spec.Source.TargetRevision)
|
||||
if app.Status.ComparisonResult.Error != "" {
|
||||
fmt.Printf(format, "Error:", app.Status.ComparisonResult.Error)
|
||||
}
|
||||
@@ -158,6 +157,22 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
|
||||
return command
|
||||
}
|
||||
|
||||
// appURL returns the URL of an application
|
||||
func appURL(acdClient argocdclient.Client, app *argoappv1.Application) string {
|
||||
var scheme string
|
||||
opts := acdClient.ClientOptions()
|
||||
server := opts.ServerAddr
|
||||
if opts.PlainText {
|
||||
scheme = "http"
|
||||
} else {
|
||||
scheme = "https"
|
||||
if strings.HasSuffix(opts.ServerAddr, ":443") {
|
||||
server = server[0 : len(server)-4]
|
||||
}
|
||||
}
|
||||
return fmt.Sprintf("%s://%s/applications/%s/%s", scheme, server, app.Namespace, app.Name)
|
||||
}
|
||||
|
||||
// NewApplicationSetCommand returns a new instance of an `argocd app set` command
|
||||
func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var (
|
||||
@@ -273,7 +288,7 @@ func NewApplicationDiffCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
|
||||
// NewApplicationDeleteCommand returns a new instance of an `argocd app delete` command
|
||||
func NewApplicationDeleteCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var (
|
||||
force bool
|
||||
cascade bool
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "delete APPNAME",
|
||||
@@ -286,25 +301,26 @@ func NewApplicationDeleteCommand(clientOpts *argocdclient.ClientOptions) *cobra.
|
||||
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
|
||||
defer util.Close(conn)
|
||||
for _, appName := range args {
|
||||
var cascade *bool
|
||||
if c.Flag("force").Changed {
|
||||
cascade = &force
|
||||
}
|
||||
appDeleteReq := application.DeleteApplicationRequest{
|
||||
Name: &appName,
|
||||
Cascade: cascade,
|
||||
Name: &appName,
|
||||
}
|
||||
if c.Flag("cascade").Changed {
|
||||
appDeleteReq.Cascade = &cascade
|
||||
}
|
||||
_, err := appIf.Delete(context.Background(), &appDeleteReq)
|
||||
errors.CheckError(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
command.Flags().BoolVar(&force, "force", false, "Force delete application even if cascaded deletion unsuccessful")
|
||||
command.Flags().BoolVar(&cascade, "cascade", true, "Perform a cascaded deletion of all application resources")
|
||||
return command
|
||||
}
|
||||
|
||||
// NewApplicationListCommand returns a new instance of an `argocd app list` command
|
||||
func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var (
|
||||
output string
|
||||
)
|
||||
var command = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List applications",
|
||||
@@ -314,25 +330,104 @@ func NewApplicationListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Co
|
||||
apps, err := appIf.List(context.Background(), &application.ApplicationQuery{})
|
||||
errors.CheckError(err)
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
fmt.Fprintf(w, "NAME\tENVIRONMENT\tTARGET\tCLUSTER\tNAMESPACE\tSTATUS\tHEALTH\n")
|
||||
var fmtStr string
|
||||
headers := []interface{}{"NAME", "CLUSTER", "NAMESPACE", "STATUS", "HEALTH"}
|
||||
if output == "wide" {
|
||||
fmtStr = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n"
|
||||
headers = append(headers, "ENV", "REPO", "TARGET")
|
||||
} else {
|
||||
fmtStr = "%s\t%s\t%s\t%s\t%s\n"
|
||||
}
|
||||
fmt.Fprintf(w, fmtStr, headers...)
|
||||
for _, app := range apps.Items {
|
||||
targetRev := app.Spec.Source.TargetRevision
|
||||
if targetRev == "" {
|
||||
targetRev = "HEAD"
|
||||
}
|
||||
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
|
||||
vals := []interface{}{
|
||||
app.Name,
|
||||
app.Spec.Source.Environment,
|
||||
targetRev,
|
||||
app.Spec.Destination.Server,
|
||||
app.Spec.Destination.Namespace,
|
||||
app.Status.ComparisonResult.Status,
|
||||
app.Status.Health.Status,
|
||||
)
|
||||
}
|
||||
if output == "wide" {
|
||||
vals = append(vals, app.Spec.Source.Environment, app.Spec.Source.RepoURL, app.Spec.Source.TargetRevision)
|
||||
}
|
||||
fmt.Fprintf(w, fmtStr, vals...)
|
||||
}
|
||||
_ = w.Flush()
|
||||
},
|
||||
}
|
||||
command.Flags().StringVarP(&output, "output", "o", "", "Output format. One of: wide")
|
||||
return command
|
||||
}
|
||||
|
||||
// NewApplicationWaitCommand returns a new instance of an `argocd app wait` command
|
||||
func NewApplicationWaitCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
|
||||
var (
|
||||
syncOnly bool
|
||||
healthOnly bool
|
||||
timeout uint
|
||||
)
|
||||
const defaultCheckTimeoutSeconds = 0
|
||||
var command = &cobra.Command{
|
||||
Use: "wait APPNAME",
|
||||
Short: "Wait for an application to reach a synced and healthy state",
|
||||
Run: func(c *cobra.Command, args []string) {
|
||||
if len(args) != 1 {
|
||||
c.HelpFunc()(c, args)
|
||||
os.Exit(1)
|
||||
}
|
||||
if syncOnly && healthOnly {
|
||||
log.Fatalln("Please specify at most one of --sync-only or --health-only.")
|
||||
}
|
||||
conn, appIf := argocdclient.NewClientOrDie(clientOpts).NewApplicationClientOrDie()
|
||||
defer util.Close(conn)
|
||||
|
||||
appName := args[0]
|
||||
wc, err := appIf.Watch(context.Background(), &application.ApplicationQuery{
|
||||
Name: &appName,
|
||||
})
|
||||
errors.CheckError(err)
|
||||
|
||||
success := util.Wait(timeout, func(done chan<- bool) {
|
||||
for {
|
||||
appEvent, err := wc.Recv()
|
||||
errors.CheckError(err)
|
||||
|
||||
app := appEvent.Application
|
||||
healthStatus := app.Status.Health.Status
|
||||
syncStatus := app.Status.ComparisonResult.Status
|
||||
|
||||
log.Printf("App %q has sync status %q and health status %q", appName, syncStatus, healthStatus)
|
||||
synced := (syncStatus == argoappv1.ComparisonStatusSynced)
|
||||
healthy := (healthStatus == argoappv1.HealthStatusHealthy)
|
||||
|
||||
if (synced && healthy) || (synced && syncOnly) || (healthy && healthOnly) {
|
||||
done <- true
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if success {
|
||||
log.Printf("App %q matches desired state", appName)
|
||||
} else {
|
||||
app, err := appIf.Get(context.Background(), &application.ApplicationQuery{Name: &appName})
|
||||
errors.CheckError(err)
|
||||
|
||||
log.Errorf("Timed out before seeing app %q match desired state", appName)
|
||||
if len(app.Status.ComparisonResult.Resources) > 0 {
|
||||
for _, res := range app.Status.ComparisonResult.Resources {
|
||||
targetObj, err := argoappv1.UnmarshalToUnstructured(res.TargetState)
|
||||
errors.CheckError(err)
|
||||
if res.Status != argoappv1.ComparisonStatusSynced || res.Health.Status != argoappv1.HealthStatusHealthy {
|
||||
log.Warnf("%s %q has sync status %q and health status %q: %s", targetObj.GetKind(), targetObj.GetName(), res.Status, res.Health.Status, res.Health.StatusDetails)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
command.Flags().BoolVar(&syncOnly, "sync-only", false, "Wait only for sync")
|
||||
command.Flags().BoolVar(&healthOnly, "health-only", false, "Wait only for health")
|
||||
command.Flags().UintVar(&timeout, "timeout", defaultCheckTimeoutSeconds, "Time out after this many seconds")
|
||||
return command
|
||||
}
|
||||
|
||||
@@ -390,11 +485,10 @@ func waitUntilOperationCompleted(appClient application.ApplicationServiceClient,
|
||||
for {
|
||||
if appEvent.Application.Status.OperationState != nil && appEvent.Application.Status.OperationState.Phase.Completed() {
|
||||
return appEvent.Application.Status.OperationState, nil
|
||||
} else {
|
||||
appEvent, err = wc.Recv()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
appEvent, err = wc.Recv()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,9 @@ func NewLoginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comman
|
||||
setConn, setIf := acdClient.NewSettingsClientOrDie()
|
||||
defer util.Close(setConn)
|
||||
|
||||
ctxName = cli.PromptMessage("Enter a name for this context", ctxName)
|
||||
if ctxName == "" {
|
||||
ctxName = server
|
||||
}
|
||||
|
||||
// Perform the login
|
||||
var tokenString string
|
||||
@@ -249,7 +251,7 @@ func oauth2Login(host string, plaintext bool) string {
|
||||
return tokenString
|
||||
}
|
||||
|
||||
func passwordLogin(acdClient argocdclient.ServerClient, username, password string) string {
|
||||
func passwordLogin(acdClient argocdclient.Client, username, password string) string {
|
||||
username, password = cli.PromptCredentials(username, password)
|
||||
sessConn, sessionIf := acdClient.NewSessionClientOrDie()
|
||||
defer util.Close(sessConn)
|
||||
@@ -262,7 +264,7 @@ func passwordLogin(acdClient argocdclient.ServerClient, username, password strin
|
||||
return createdSession.Token
|
||||
}
|
||||
|
||||
func tokenLogin(acdClient argocdclient.ServerClient, token string) string {
|
||||
func tokenLogin(acdClient argocdclient.Client, token string) string {
|
||||
sessConn, sessionIf := acdClient.NewSessionClientOrDie()
|
||||
defer util.Close(sessConn)
|
||||
sessionRequest := session.SessionCreateRequest{
|
||||
|
||||
BIN
docs/assets/oauth2-config.png
Normal file
BIN
docs/assets/oauth2-config.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
BIN
docs/assets/register-app.png
Normal file
BIN
docs/assets/register-app.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
BIN
docs/assets/webhook-config.png
Normal file
BIN
docs/assets/webhook-config.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
@@ -11,7 +11,7 @@ An example Ksonnet guestbook application is provided to demonstrates how Argo CD
|
||||
|
||||
Download the latest Argo CD version
|
||||
```
|
||||
curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/v0.3.1/argocd-darwin-amd64
|
||||
curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/v0.4.0/argocd-darwin-amd64
|
||||
chmod +x /usr/local/bin/argocd
|
||||
```
|
||||
|
||||
@@ -31,7 +31,7 @@ change service type to `LoadBalancer`:
|
||||
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
|
||||
```
|
||||
|
||||
# 4. Login to the server from the CLI
|
||||
## 4. Login to the server from the CLI
|
||||
|
||||
```
|
||||
argocd login $(minikube service argocd-server -n argocd --url | cut -d'/' -f 3)
|
||||
|
||||
72
docs/sso.md
Normal file
72
docs/sso.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# SSO Configuration
|
||||
|
||||
## Overview
|
||||
|
||||
ArgoCD embeds and bundles [Dex](https://github.com/coreos/dex) as part of its installation, for the
|
||||
purposes of delegating authentication to an external identity provider. Multiple types of identity
|
||||
providers are supported (OIDC, SAML, LDAP, GitHub, etc...). SSO configuration of ArgoCD requires
|
||||
editing the `argocd-cm` ConfigMap with a
|
||||
[Dex connector](https://github.com/coreos/dex/tree/master/Documentation/connectors) settings.
|
||||
|
||||
This document describes how to configure ArgoCD SSO using GitHub (OAuth2) as an example, but the
|
||||
steps should be similar for other identity providers.
|
||||
|
||||
### 1. Register the application in the identity provider
|
||||
|
||||
In GitHub, register a new application. The callback address should be the `/api/dex/callback`
|
||||
endpoint of your ArgoCD URL (e.g. https://argocd.example.com/api/dex/callback).
|
||||
|
||||

|
||||
|
||||
After registering the app, you will receive an OAuth2 client ID and secret. These values will be
|
||||
inputted into the ArgoCD configmap.
|
||||
|
||||

|
||||
|
||||
### 2. Configure ArgoCD for SSO
|
||||
|
||||
Edit the argocd-cm configmap:
|
||||
```
|
||||
kubectl edit configmap argocd-cm
|
||||
```
|
||||
|
||||
* In the `url` key, input the base URL of ArgoCD. In this example, it is https://argocd.example.com
|
||||
* In the `dex.config` key, add the `github` connector to the `connectors` sub field. See Dex's
|
||||
[GitHub connector](https://github.com/coreos/dex/blob/master/Documentation/connectors/github.md)
|
||||
documentation for explanation of the fields. A minimal config should populate the clientID,
|
||||
clientSecret generated in Step 1.
|
||||
* You will very likely want to restrict logins to one ore more GitHub organization. In the
|
||||
`connectors.config.orgs` list, add one or more GitHub organizations. Any member of the org will
|
||||
then be able to login to ArgoCD to perform management tasks.
|
||||
|
||||
```
|
||||
data:
|
||||
url: https://argocd.example.com
|
||||
|
||||
dex.config: |
|
||||
connectors:
|
||||
- type: github
|
||||
id: github
|
||||
name: GitHub
|
||||
config:
|
||||
clientID: 5aae0fcec2c11634be8c
|
||||
clientSecret: c6fcb18177869174bd09be2c51259fb049c9d4e5
|
||||
orgs:
|
||||
- name: your-github-org
|
||||
```
|
||||
|
||||
NOTES:
|
||||
* Any values which start with '$' will look to a key in argocd-secret of the same name (minus the $),
|
||||
to obtain the actual value. This allows you to store the `clientSecret` as a kubernetes secret.
|
||||
* There is no need to set `redirectURI` in the `connectors.config` as shown in the dex documentation.
|
||||
ArgoCD will automatically use the correct `redirectURI` for any OAuth2 connectors, to match the
|
||||
correct external callback URL (e.g. https://argocd.example.com/api/dex/callback)
|
||||
|
||||
### 3. Restart ArgoCD for changes to take effect
|
||||
Any changes to the `argocd-cm` ConfigMap or `argocd-secret` Secret, currently require a restart of
|
||||
the ArgoCD API server for the settings to take effect. Delete the `argocd-server` pod to force a
|
||||
restart. [Issue #174](https://github.com/argoproj/argo-cd/issues/174) will address this limitation.
|
||||
|
||||
```
|
||||
kubectl delete pod -l app=argocd-server
|
||||
```
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
An ArgoCD application spec provides several different ways of track kubernetes resource manifests in git. This document describes the different techniques and the means of deploying those manifests to the target environment.
|
||||
|
||||
## Auto-Sync
|
||||
|
||||
In all tracking strategies described below, the application has the option to sync automatically. If auto-sync is configured, the new resources manifests will be applied automatically -- as soon as a difference is detected between the target state (git) and live state. If auto-sync is disabled, a manual sync will be needed using the Argo UI, CLI, or API.
|
||||
|
||||
## Branch Tracking
|
||||
|
||||
If a branch name is specified, ArgoCD will continually compare live state against the resource manifests defined at the tip of the specified branch.
|
||||
@@ -23,12 +19,13 @@ To redeploy an application, the user uses git to change the meaning of a tag by
|
||||
If a git commit SHA is specified, the application is effectively pinned to the manifests defined at the specified commit. This is the most restrictive of the techniques and is typically used to control production environments.
|
||||
|
||||
Since commit SHAs cannot change meaning, the only way to change the live state of an application which is pinned to a commit, is by updating the tracking revision in the application to a different commit containing the new manifests.
|
||||
Note that parameter overrides can still be made against a application which is pinned to a revision.
|
||||
|
||||
## Parameter Overrides
|
||||
|
||||
ArgoCD provides means to override the parameters of a ksonnet app. This gives some extra flexibility in having *some* parts of the k8s manifests determined dynamically. It also serves as an alternative way of redeploying an application by changing application parameters via ArgoCD, instead of making the changes to the manifests in git.
|
||||
|
||||
The following is an example of where this would be useful: A team maintains a "dev" environment, which needs to be continually updated with the latest version of their guestbook application after every build in the tip of master. To solve this, the ksonnet application would expose an parameter named `image`, whose value used in the `dev` environment contains a placeholder value (e.g. `example/guestbook:replaceme`) intended to be set externally (outside of git) such as by build systems. As part of the build pipeline, the parameter value of the `image` would be continually updated to the freshly built image (e.g. `example/guestbook:abcd123`). A sync operation would result in the application being redeployed with the new image.
|
||||
The following is an example of where this would be useful: A team maintains a "dev" environment, which needs to be continually updated with the latest version of their guestbook application after every build in the tip of master. To address this use case, the ksonnet application should expose an parameter named `image`, whose value used in the `dev` environment contains a placeholder value (e.g. `example/guestbook:replaceme`), intended to be set externally (outside of git) such as a build systems. As part of the build pipeline, the parameter value of the `image` would be continually updated to the freshly built image (e.g. `example/guestbook:abcd123`). A sync operation would result in the application being redeployed with the new image.
|
||||
|
||||
ArgoCD provides these operations conveniently via the CLI, or alternatively via the gRPC/REST API.
|
||||
```
|
||||
@@ -38,3 +35,7 @@ $ argocd app sync guestbook
|
||||
|
||||
Note that in all tracking strategies, any parameter overrides set in the application instance will be honored.
|
||||
|
||||
|
||||
## [Auto-Sync](https://github.com/argoproj/argo-cd/issues/79) (Not Yet Implemented)
|
||||
|
||||
In all tracking strategies, the application will have the option to sync automatically. If auto-sync is configured, the new resources manifests will be applied automatically -- as soon as a difference is detected between the target state (git) and live state. If auto-sync is disabled, a manual sync will be needed using the Argo UI, CLI, or API.
|
||||
|
||||
70
docs/webhook.md
Normal file
70
docs/webhook.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Git Webhook Configuration
|
||||
|
||||
## Overview
|
||||
|
||||
ArgoCD will poll git repositories every three minutes for changes to the manifests. To eliminate
|
||||
this delay from polling, the API server can be configured to receive webhook events. ArgoCD supports
|
||||
git webhook notifications from GitHub, GitLab, and BitBucket. The following explains how to configure
|
||||
a git webhook for GitHub, but the same process should be applicable to other providers.
|
||||
|
||||
### 1. Create the webhook in the git provider
|
||||
|
||||
In your git provider, navigate to the settings page where webhooks can be configured. The payload
|
||||
URL configured in the git provider should use the /api/webhook endpoint of your ArgoCD instance
|
||||
(e.g. https://argocd.example.com/api/webhook). Input an arbitrary value in the secret. The same
|
||||
value will be used when configuring the webhook in step 2.
|
||||
|
||||

|
||||
|
||||
### 2. Configure ArgoCD with the webhook secret
|
||||
|
||||
In the `argocd-secret` kubernetes secret, configure one of the following keys with the git provider
|
||||
webhook secret configured in step 1.
|
||||
|
||||
| Provider | K8s Secret Key |
|
||||
|---------- | ------------------------ |
|
||||
| GitHub | `github.webhook.secret` |
|
||||
| GitLab | `gitlab.webhook.secret` |
|
||||
| BitBucket | `bitbucket.webhook.uuid` |
|
||||
|
||||
Edit the ArgoCD kubernetes secret:
|
||||
```
|
||||
kubectl edit secret argocd-secret
|
||||
```
|
||||
|
||||
TIP: for ease of entering secrets, kubernetes supports inputting secrets in the `stringData` field,
|
||||
which saves you the trouble of base64 encoding the values and copying it to the `data` field.
|
||||
Simply copy the shared webhook secret created in step 1, to the corresponding
|
||||
GitHub/GitLab/BitBucket key under the `stringData` field:
|
||||
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: argocd-secret
|
||||
namespace: argocd
|
||||
type: Opaque
|
||||
data:
|
||||
...
|
||||
|
||||
stringData:
|
||||
# github webhook secret
|
||||
github.webhook.secret: shhhh! it's a github secret
|
||||
|
||||
# gitlab webhook secret
|
||||
gitlab.webhook.secret: shhhh! it's a gitlab secret
|
||||
|
||||
# bitbucket webhook secret
|
||||
bitbucket.webhook.uuid: your-bitbucket-uuid
|
||||
|
||||
```
|
||||
|
||||
### 3. Restart ArgoCD for changes to take effect
|
||||
Any changes to the `argocd-cm` ConfigMap or `argocd-secret` Secret, currently require a restart of
|
||||
the ArgoCD API server for the settings to take effect. Delete the `argocd-server` pod to force a
|
||||
restart. [Issue #174](https://github.com/argoproj/argo-cd/issues/174) will address this limitation.
|
||||
|
||||
```
|
||||
kubectl delete pod -l app=argocd-server
|
||||
```
|
||||
@@ -12,7 +12,10 @@ stringData:
|
||||
# random server signature key for session validation
|
||||
server.secretkey: aEDvv73vv70F77+9CRBSNu+/vTYQ77+9EUFh77+9LzFyJ++/vXfLsO+/vWRbeu+/ve+/vQ==
|
||||
|
||||
# these keys hold the shared secret for authenticating GitHub/GitLab webhook events
|
||||
# The following keys hold the shared secret for authenticating GitHub/GitLab/BitBucket webhook
|
||||
# events. To enable webhooks, configure one or more of the following keys with the shared git
|
||||
# provider webhook secret. The payload URL configured in the git provider should use the
|
||||
# /api/webhook endpoint of your ArgoCD instance (e.g. https://argocd.example.com/api/webhook)
|
||||
github.webhook.secret: shhhh! it's a github secret
|
||||
gitlab.webhook.secret: shhhh! it's a gitlab secret
|
||||
bitbucket.webhook.uuid: your-bitbucket-uuid
|
||||
|
||||
@@ -32,8 +32,9 @@ const (
|
||||
EnvArgoCDAuthToken = "ARGOCD_AUTH_TOKEN"
|
||||
)
|
||||
|
||||
// ServerClient defines an interface for interaction with an Argo CD server.
|
||||
type ServerClient interface {
|
||||
// Client defines an interface for interaction with an Argo CD server.
|
||||
type Client interface {
|
||||
ClientOptions() ClientOptions
|
||||
NewConn() (*grpc.ClientConn, error)
|
||||
NewRepoClient() (*grpc.ClientConn, repository.RepositoryServiceClient, error)
|
||||
NewRepoClientOrDie() (*grpc.ClientConn, repository.RepositoryServiceClient)
|
||||
@@ -69,7 +70,7 @@ type client struct {
|
||||
}
|
||||
|
||||
// NewClient creates a new API client from a set of config options.
|
||||
func NewClient(opts *ClientOptions) (ServerClient, error) {
|
||||
func NewClient(opts *ClientOptions) (Client, error) {
|
||||
var c client
|
||||
localCfg, err := localconfig.ReadLocalConfig(opts.ConfigPath)
|
||||
if err != nil {
|
||||
@@ -134,7 +135,7 @@ func NewClient(opts *ClientOptions) (ServerClient, error) {
|
||||
}
|
||||
|
||||
// NewClientOrDie creates a new API client from a set of config options, or fails fatally if the new client creation fails.
|
||||
func NewClientOrDie(opts *ClientOptions) ServerClient {
|
||||
func NewClientOrDie(opts *ClientOptions) Client {
|
||||
client, err := NewClient(opts)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -181,6 +182,15 @@ func (c *client) NewConn() (*grpc.ClientConn, error) {
|
||||
return grpc_util.BlockingDial(context.Background(), "tcp", c.ServerAddr, creds, grpc.WithPerRPCCredentials(endpointCredentials))
|
||||
}
|
||||
|
||||
func (c *client) ClientOptions() ClientOptions {
|
||||
return ClientOptions{
|
||||
ServerAddr: c.ServerAddr,
|
||||
PlainText: c.PlainText,
|
||||
Insecure: c.Insecure,
|
||||
AuthToken: c.AuthToken,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *client) NewRepoClient() (*grpc.ClientConn, repository.RepositoryServiceClient, error) {
|
||||
conn, err := c.NewConn()
|
||||
if err != nil {
|
||||
|
||||
@@ -86,6 +86,46 @@ func (s *Server) Create(ctx context.Context, a *appv1.Application) (*appv1.Appli
|
||||
return out, err
|
||||
}
|
||||
|
||||
// GetManifests returns application manifests
|
||||
func (s *Server) GetManifests(ctx context.Context, q *ManifestQuery) (*repository.ManifestResponse, error) {
|
||||
app, err := s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Get(*q.AppName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
repo := s.getRepo(ctx, app.Spec.Source.RepoURL)
|
||||
|
||||
conn, repoClient, err := s.repoClientset.NewRepositoryClient()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer util.Close(conn)
|
||||
overrides := make([]*appv1.ComponentParameter, len(app.Spec.Source.ComponentParameterOverrides))
|
||||
if app.Spec.Source.ComponentParameterOverrides != nil {
|
||||
for i := range app.Spec.Source.ComponentParameterOverrides {
|
||||
item := app.Spec.Source.ComponentParameterOverrides[i]
|
||||
overrides[i] = &item
|
||||
}
|
||||
}
|
||||
|
||||
revision := app.Spec.Source.TargetRevision
|
||||
if q.Revision != nil && *q.Revision != "" {
|
||||
revision = *q.Revision
|
||||
}
|
||||
manifestInfo, err := repoClient.GenerateManifest(context.Background(), &repository.ManifestRequest{
|
||||
Repo: repo,
|
||||
Environment: app.Spec.Source.Environment,
|
||||
Path: app.Spec.Source.Path,
|
||||
Revision: revision,
|
||||
ComponentParameterOverrides: overrides,
|
||||
AppLabel: app.Name,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return manifestInfo, nil
|
||||
}
|
||||
|
||||
// Get returns an application by name
|
||||
func (s *Server) Get(ctx context.Context, q *ApplicationQuery) (*appv1.Application, error) {
|
||||
return s.appclientset.ArgoprojV1alpha1().Applications(s.ns).Get(*q.Name, metav1.GetOptions{})
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
It has these top-level messages:
|
||||
ApplicationQuery
|
||||
ManifestQuery
|
||||
ApplicationResponse
|
||||
DeleteApplicationRequest
|
||||
ApplicationSyncRequest
|
||||
@@ -32,6 +33,7 @@ import _ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
import _ "k8s.io/api/core/v1"
|
||||
import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
import github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
|
||||
import repository "github.com/argoproj/argo-cd/reposerver/repository"
|
||||
|
||||
import context "golang.org/x/net/context"
|
||||
import grpc "google.golang.org/grpc"
|
||||
@@ -67,6 +69,32 @@ func (m *ApplicationQuery) GetName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// ManifestQuery is a query for manifest resources
|
||||
type ManifestQuery struct {
|
||||
AppName *string `protobuf:"bytes,1,req,name=appName" json:"appName,omitempty"`
|
||||
Revision *string `protobuf:"bytes,2,opt,name=revision" json:"revision,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ManifestQuery) Reset() { *m = ManifestQuery{} }
|
||||
func (m *ManifestQuery) String() string { return proto.CompactTextString(m) }
|
||||
func (*ManifestQuery) ProtoMessage() {}
|
||||
func (*ManifestQuery) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{1} }
|
||||
|
||||
func (m *ManifestQuery) GetAppName() string {
|
||||
if m != nil && m.AppName != nil {
|
||||
return *m.AppName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ManifestQuery) GetRevision() string {
|
||||
if m != nil && m.Revision != nil {
|
||||
return *m.Revision
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ApplicationResponse struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
@@ -74,7 +102,7 @@ type ApplicationResponse struct {
|
||||
func (m *ApplicationResponse) Reset() { *m = ApplicationResponse{} }
|
||||
func (m *ApplicationResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ApplicationResponse) ProtoMessage() {}
|
||||
func (*ApplicationResponse) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{1} }
|
||||
func (*ApplicationResponse) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{2} }
|
||||
|
||||
type DeleteApplicationRequest struct {
|
||||
Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
|
||||
@@ -86,7 +114,7 @@ func (m *DeleteApplicationRequest) Reset() { *m = DeleteApplicationReque
|
||||
func (m *DeleteApplicationRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteApplicationRequest) ProtoMessage() {}
|
||||
func (*DeleteApplicationRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptorApplication, []int{2}
|
||||
return fileDescriptorApplication, []int{3}
|
||||
}
|
||||
|
||||
func (m *DeleteApplicationRequest) GetName() string {
|
||||
@@ -116,7 +144,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 fileDescriptorApplication, []int{3}
|
||||
return fileDescriptorApplication, []int{4}
|
||||
}
|
||||
|
||||
func (m *ApplicationSyncRequest) GetName() string {
|
||||
@@ -158,7 +186,7 @@ func (m *ApplicationSpecRequest) Reset() { *m = ApplicationSpecRequest{}
|
||||
func (m *ApplicationSpecRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ApplicationSpecRequest) ProtoMessage() {}
|
||||
func (*ApplicationSpecRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptorApplication, []int{4}
|
||||
return fileDescriptorApplication, []int{5}
|
||||
}
|
||||
|
||||
func (m *ApplicationSpecRequest) GetAppName() string {
|
||||
@@ -187,7 +215,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 fileDescriptorApplication, []int{5}
|
||||
return fileDescriptorApplication, []int{6}
|
||||
}
|
||||
|
||||
func (m *ApplicationRollbackRequest) GetName() string {
|
||||
@@ -227,7 +255,7 @@ type DeletePodQuery struct {
|
||||
func (m *DeletePodQuery) Reset() { *m = DeletePodQuery{} }
|
||||
func (m *DeletePodQuery) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeletePodQuery) ProtoMessage() {}
|
||||
func (*DeletePodQuery) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{6} }
|
||||
func (*DeletePodQuery) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{7} }
|
||||
|
||||
func (m *DeletePodQuery) GetApplicationName() string {
|
||||
if m != nil && m.ApplicationName != nil {
|
||||
@@ -257,7 +285,7 @@ type PodLogsQuery struct {
|
||||
func (m *PodLogsQuery) Reset() { *m = PodLogsQuery{} }
|
||||
func (m *PodLogsQuery) String() string { return proto.CompactTextString(m) }
|
||||
func (*PodLogsQuery) ProtoMessage() {}
|
||||
func (*PodLogsQuery) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{7} }
|
||||
func (*PodLogsQuery) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{8} }
|
||||
|
||||
func (m *PodLogsQuery) GetApplicationName() string {
|
||||
if m != nil && m.ApplicationName != nil {
|
||||
@@ -317,7 +345,7 @@ type LogEntry struct {
|
||||
func (m *LogEntry) Reset() { *m = LogEntry{} }
|
||||
func (m *LogEntry) String() string { return proto.CompactTextString(m) }
|
||||
func (*LogEntry) ProtoMessage() {}
|
||||
func (*LogEntry) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{8} }
|
||||
func (*LogEntry) Descriptor() ([]byte, []int) { return fileDescriptorApplication, []int{9} }
|
||||
|
||||
func (m *LogEntry) GetContent() string {
|
||||
if m != nil {
|
||||
@@ -335,6 +363,7 @@ func (m *LogEntry) GetTimeStamp() k8s_io_apimachinery_pkg_apis_meta_v1.Time {
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ApplicationQuery)(nil), "application.ApplicationQuery")
|
||||
proto.RegisterType((*ManifestQuery)(nil), "application.ManifestQuery")
|
||||
proto.RegisterType((*ApplicationResponse)(nil), "application.ApplicationResponse")
|
||||
proto.RegisterType((*DeleteApplicationRequest)(nil), "application.DeleteApplicationRequest")
|
||||
proto.RegisterType((*ApplicationSyncRequest)(nil), "application.ApplicationSyncRequest")
|
||||
@@ -364,6 +393,8 @@ type ApplicationServiceClient interface {
|
||||
Create(ctx context.Context, in *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, opts ...grpc.CallOption) (*github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, error)
|
||||
// Get returns an application by name
|
||||
Get(ctx context.Context, in *ApplicationQuery, opts ...grpc.CallOption) (*github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, error)
|
||||
// GetManifests returns application manifests
|
||||
GetManifests(ctx context.Context, in *ManifestQuery, opts ...grpc.CallOption) (*repository.ManifestResponse, error)
|
||||
// Update updates an application
|
||||
Update(ctx context.Context, in *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, opts ...grpc.CallOption) (*github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, error)
|
||||
// Update updates an application spec
|
||||
@@ -447,6 +478,15 @@ func (c *applicationServiceClient) Get(ctx context.Context, in *ApplicationQuery
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *applicationServiceClient) GetManifests(ctx context.Context, in *ManifestQuery, opts ...grpc.CallOption) (*repository.ManifestResponse, error) {
|
||||
out := new(repository.ManifestResponse)
|
||||
err := grpc.Invoke(ctx, "/application.ApplicationService/GetManifests", in, out, c.cc, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *applicationServiceClient) Update(ctx context.Context, in *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, opts ...grpc.CallOption) (*github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, error) {
|
||||
out := new(github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application)
|
||||
err := grpc.Invoke(ctx, "/application.ApplicationService/Update", in, out, c.cc, opts...)
|
||||
@@ -544,6 +584,8 @@ type ApplicationServiceServer interface {
|
||||
Create(context.Context, *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application) (*github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, error)
|
||||
// Get returns an application by name
|
||||
Get(context.Context, *ApplicationQuery) (*github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, error)
|
||||
// GetManifests returns application manifests
|
||||
GetManifests(context.Context, *ManifestQuery) (*repository.ManifestResponse, error)
|
||||
// Update updates an application
|
||||
Update(context.Context, *github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application) (*github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application, error)
|
||||
// Update updates an application spec
|
||||
@@ -639,6 +681,24 @@ func _ApplicationService_Get_Handler(srv interface{}, ctx context.Context, dec f
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ApplicationService_GetManifests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ManifestQuery)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ApplicationServiceServer).GetManifests(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/application.ApplicationService/GetManifests",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ApplicationServiceServer).GetManifests(ctx, req.(*ManifestQuery))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ApplicationService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(github_com_argoproj_argo_cd_pkg_apis_application_v1alpha1.Application)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -784,6 +844,10 @@ var _ApplicationService_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "Get",
|
||||
Handler: _ApplicationService_Get_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetManifests",
|
||||
Handler: _ApplicationService_GetManifests_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Update",
|
||||
Handler: _ApplicationService_Update_Handler,
|
||||
@@ -851,6 +915,41 @@ func (m *ApplicationQuery) MarshalTo(dAtA []byte) (int, error) {
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *ManifestQuery) 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 *ManifestQuery) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.AppName == nil {
|
||||
return 0, proto.NewRequiredNotSetError("appName")
|
||||
} else {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintApplication(dAtA, i, uint64(len(*m.AppName)))
|
||||
i += copy(dAtA[i:], *m.AppName)
|
||||
}
|
||||
if m.Revision != nil {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintApplication(dAtA, i, uint64(len(*m.Revision)))
|
||||
i += copy(dAtA[i:], *m.Revision)
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func (m *ApplicationResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
@@ -1202,6 +1301,23 @@ func (m *ApplicationQuery) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *ManifestQuery) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
if m.AppName != nil {
|
||||
l = len(*m.AppName)
|
||||
n += 1 + l + sovApplication(uint64(l))
|
||||
}
|
||||
if m.Revision != nil {
|
||||
l = len(*m.Revision)
|
||||
n += 1 + l + sovApplication(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *ApplicationResponse) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
@@ -1425,6 +1541,122 @@ func (m *ApplicationQuery) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *ManifestQuery) 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: ManifestQuery: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: ManifestQuery: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AppName", 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.AppName = &s
|
||||
iNdEx = postIndex
|
||||
hasFields[0] |= uint64(0x00000001)
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Revision", 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.Revision = &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 proto.NewRequiredNotSetError("appName")
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *ApplicationResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@@ -2630,67 +2862,72 @@ var (
|
||||
func init() { proto.RegisterFile("server/application/application.proto", fileDescriptorApplication) }
|
||||
|
||||
var fileDescriptorApplication = []byte{
|
||||
// 990 bytes of a gzipped FileDescriptorProto
|
||||
// 1063 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4f, 0x6f, 0xdc, 0x44,
|
||||
0x14, 0x67, 0x9c, 0xed, 0xfe, 0x79, 0x29, 0x7f, 0x34, 0xb4, 0x95, 0xeb, 0xa6, 0xc9, 0xca, 0x49,
|
||||
0x61, 0x09, 0xc2, 0x6e, 0x22, 0x10, 0xa8, 0x2a, 0x07, 0x42, 0x0b, 0x2d, 0x8a, 0xaa, 0xb0, 0x29,
|
||||
0x42, 0xe2, 0x82, 0xa6, 0xf6, 0xe0, 0x98, 0x78, 0x67, 0x8c, 0x67, 0x76, 0xd1, 0x52, 0xe5, 0x00,
|
||||
0x07, 0x04, 0x27, 0x84, 0xb8, 0x70, 0x83, 0x0f, 0x50, 0x3e, 0x00, 0xdf, 0xa0, 0xdc, 0x90, 0xb8,
|
||||
0x57, 0x28, 0xe2, 0xcc, 0x67, 0x40, 0x33, 0xb6, 0xd7, 0xb3, 0xc9, 0xee, 0x96, 0x3f, 0x3e, 0x70,
|
||||
0x1b, 0xbf, 0x79, 0xf3, 0xde, 0xef, 0xbd, 0xdf, 0x9b, 0x79, 0xcf, 0xb0, 0x21, 0x68, 0x36, 0xa2,
|
||||
0x99, 0x4f, 0xd2, 0x34, 0x89, 0x03, 0x22, 0x63, 0xce, 0xcc, 0xb5, 0x97, 0x66, 0x5c, 0x72, 0xbc,
|
||||
0x6c, 0x88, 0x9c, 0x73, 0x11, 0x8f, 0xb8, 0x96, 0xfb, 0x6a, 0x95, 0xab, 0x38, 0x2b, 0x11, 0xe7,
|
||||
0x51, 0x42, 0x7d, 0x92, 0xc6, 0x3e, 0x61, 0x8c, 0x4b, 0xad, 0x2c, 0x8a, 0x5d, 0xf7, 0xf0, 0x35,
|
||||
0xe1, 0xc5, 0x5c, 0xef, 0x06, 0x3c, 0xa3, 0xfe, 0x68, 0xcb, 0x8f, 0x28, 0xa3, 0x19, 0x91, 0x34,
|
||||
0x2c, 0x74, 0x5e, 0xae, 0x74, 0x06, 0x24, 0x38, 0x88, 0x19, 0xcd, 0xc6, 0x7e, 0x7a, 0x18, 0x29,
|
||||
0x81, 0xf0, 0x07, 0x54, 0x92, 0x59, 0xa7, 0x6e, 0x47, 0xb1, 0x3c, 0x18, 0xde, 0xf3, 0x02, 0x3e,
|
||||
0xf0, 0x49, 0xa6, 0x81, 0x7d, 0xac, 0x17, 0x2f, 0x05, 0x61, 0x75, 0xda, 0x0c, 0x6f, 0xb4, 0x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0x45, 0x91, 0x67,
|
||||
0x56, 0x5d, 0x49, 0x91, 0x77, 0xc2, 0x75, 0x81, 0x4d, 0x5b, 0x77, 0xbf, 0x44, 0xe0, 0x98, 0xa9,
|
||||
0xe6, 0x49, 0x72, 0x8f, 0x04, 0x87, 0x8b, 0x32, 0xe5, 0x80, 0x15, 0x87, 0x1a, 0xd6, 0xd2, 0x0e,
|
||||
0x28, 0x53, 0xc7, 0x8f, 0xd6, 0xac, 0xdb, 0x37, 0xfa, 0x56, 0x1c, 0xfe, 0x87, 0x1c, 0xdd, 0x85,
|
||||
0xa7, 0x72, 0xe2, 0xf7, 0x78, 0x98, 0x57, 0x4d, 0x0f, 0x9e, 0x36, 0xc2, 0x31, 0x52, 0x74, 0x52,
|
||||
0xac, 0x92, 0x98, 0xf2, 0x50, 0x6b, 0x58, 0x79, 0x12, 0x8b, 0x4f, 0xf7, 0x81, 0x05, 0x67, 0xf7,
|
||||
0x78, 0xb8, 0xcb, 0x23, 0x51, 0x9b, 0x51, 0xec, 0x42, 0x27, 0xe0, 0x4c, 0x12, 0x75, 0xb9, 0x74,
|
||||
0x9c, 0x65, 0xad, 0x54, 0x62, 0xdc, 0x83, 0xb3, 0x22, 0x66, 0x01, 0xdd, 0xa7, 0x01, 0x67, 0xa1,
|
||||
0xd0, 0x11, 0x2f, 0x15, 0x6a, 0x53, 0x3b, 0xf8, 0x16, 0x74, 0xf4, 0xf7, 0xdd, 0x78, 0x40, 0xed,
|
||||
0x33, 0x5d, 0xd4, 0x5b, 0xde, 0xde, 0xf4, 0xf2, 0x5b, 0xec, 0x99, 0xb7, 0xb8, 0x22, 0x59, 0xdd,
|
||||
0x62, 0x6f, 0xb4, 0xe5, 0xa9, 0x13, 0xfd, 0xea, 0xb0, 0xc2, 0x25, 0x49, 0x9c, 0xec, 0xc6, 0x8c,
|
||||
0x0a, 0xbb, 0x69, 0x38, 0xac, 0xc4, 0x8a, 0xa0, 0x8f, 0x78, 0x92, 0xf0, 0x4f, 0xed, 0x96, 0x49,
|
||||
0x50, 0x2e, 0x73, 0x3f, 0x83, 0xf6, 0x2e, 0x8f, 0x6e, 0x32, 0x99, 0x8d, 0xf1, 0x2a, 0xb4, 0x54,
|
||||
0x38, 0x94, 0xc9, 0x3c, 0x43, 0x85, 0x6a, 0x29, 0xc4, 0x77, 0xa0, 0x23, 0xe3, 0x01, 0xdd, 0x97,
|
||||
0x64, 0x90, 0x16, 0x45, 0xfa, 0x0f, 0x70, 0x4f, 0x90, 0x95, 0x26, 0xb6, 0xff, 0x7c, 0x12, 0xb0,
|
||||
0x59, 0xa9, 0x34, 0x1b, 0xc5, 0x01, 0xc5, 0xdf, 0x20, 0x68, 0xec, 0xc6, 0x42, 0xe2, 0xcb, 0x53,
|
||||
0xc5, 0x7d, 0xf2, 0x8d, 0x71, 0x6a, 0xba, 0x20, 0xca, 0x95, 0xbb, 0xf2, 0xc5, 0x6f, 0x7f, 0x7c,
|
||||
0x67, 0x5d, 0xc0, 0xe7, 0xf4, 0x53, 0x3b, 0xda, 0x32, 0x5f, 0x3e, 0x81, 0x7f, 0x40, 0x70, 0xe6,
|
||||
0x7d, 0x22, 0x83, 0x83, 0xc7, 0x41, 0xda, 0xab, 0x07, 0x92, 0xf6, 0x75, 0x73, 0x44, 0x99, 0x74,
|
||||
0xd7, 0x35, 0xb0, 0xcb, 0xf8, 0x52, 0x09, 0x4c, 0xc8, 0x8c, 0x92, 0xc1, 0x14, 0xbe, 0xab, 0x08,
|
||||
0xff, 0x8c, 0xa0, 0xf9, 0x66, 0x46, 0x89, 0xa4, 0xf8, 0xad, 0x7a, 0x30, 0x38, 0x35, 0xd9, 0x71,
|
||||
0xd7, 0x74, 0x04, 0x17, 0xdd, 0x99, 0xa9, 0xbd, 0x86, 0x36, 0xf1, 0xb7, 0x08, 0x96, 0xde, 0xa6,
|
||||
0x8f, 0xa5, 0xbb, 0x2e, 0x3c, 0xa7, 0x32, 0x6a, 0xe2, 0xf1, 0xef, 0xab, 0x07, 0xef, 0x08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x12, 0x11, 0x67, 0x0d, 0x4b, 0x9b,
|
||||
0x18, 0xee, 0x9d, 0x0b, 0xf8, 0x05, 0x03, 0xae, 0x03, 0x22, 0xe1, 0x4c, 0x80, 0x73, 0x0b, 0x37,
|
||||
0x6e, 0x40, 0x0c, 0x12, 0x2a, 0x87, 0x9f, 0xf5, 0x40, 0x48, 0x83, 0x8d, 0x55, 0xb0, 0x51, 0xe0,
|
||||
0x3e, 0x15, 0x3e, 0x0d, 0x40, 0x23, 0x2c, 0x74, 0x8a, 0xad, 0xf3, 0x35, 0xc2, 0x17, 0x0d, 0x23,
|
||||
0xfb, 0x03, 0xe6, 0x4f, 0x32, 0xd4, 0xac, 0x70, 0xb5, 0x5a, 0xf5, 0x76, 0xed, 0xf1, 0x93, 0xd5,
|
||||
0x67, 0x4a, 0xc6, 0x64, 0x19, 0xcf, 0x05, 0xe9, 0xa0, 0xd3, 0x63, 0x8d, 0x99, 0xa6, 0xd5, 0x5a,
|
||||
0xc8, 0xcf, 0x73, 0x19, 0xb1, 0xf1, 0x6c, 0x92, 0xf6, 0x18, 0x34, 0x6a, 0xc6, 0x61, 0x26, 0x72,
|
||||
0x7e, 0x38, 0x41, 0x25, 0x81, 0x21, 0x95, 0xf1, 0xc1, 0x0b, 0x70, 0x4d, 0x24, 0xe0, 0x6b, 0x32,
|
||||
0x8b, 0xdb, 0xef, 0xb9, 0x65, 0x8a, 0xdd, 0x22, 0xc5, 0x7a, 0xf1, 0x89, 0x1f, 0xb8, 0xc9, 0x61,
|
||||
0xe8, 0xaa, 0x6a, 0x71, 0xcd, 0x0b, 0x50, 0x54, 0x8b, 0x7b, 0x02, 0x3a, 0xe7, 0xa6, 0xad, 0x3b,
|
||||
0x5f, 0x21, 0x6c, 0x9b, 0xa1, 0xe6, 0x71, 0x7c, 0x8f, 0xfa, 0x87, 0x93, 0x22, 0x65, 0x63, 0x2b,
|
||||
0x0a, 0x34, 0xad, 0x99, 0x36, 0x56, 0xa6, 0x8e, 0x9f, 0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17, 0x08, 0xcf, 0xe7, 0x33, 0x09, 0xb9, 0x54, 0x01, 0x33, 0x27, 0x15, 0xfb,
|
||||
0x42, 0xe5, 0xa8, 0x68, 0xcb, 0x4e, 0x5b, 0x83, 0x5f, 0x27, 0xd7, 0xfe, 0x13, 0xb8, 0x17, 0xf3,
|
||||
0x50, 0x6c, 0xa2, 0xf6, 0xf5, 0xc7, 0xc7, 0x2b, 0xe8, 0xb7, 0xe3, 0x15, 0xf4, 0xc7, 0xf1, 0x0a,
|
||||
0xfa, 0xd8, 0x9d, 0xf4, 0xfb, 0x70, 0xfa, 0x37, 0xeb, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x73,
|
||||
0xe9, 0x64, 0x22, 0x7b, 0x0d, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -111,6 +111,41 @@ func request_ApplicationService_Get_0(ctx context.Context, marshaler runtime.Mar
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_ApplicationService_GetManifests_0 = &utilities.DoubleArray{Encoding: map[string]int{"appName": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
||||
func request_ApplicationService_GetManifests_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ManifestQuery
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["appName"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "appName")
|
||||
}
|
||||
|
||||
protoReq.AppName, err = runtime.StringP(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "appName", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ApplicationService_GetManifests_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetManifests(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_ApplicationService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client ApplicationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq v1alpha1.Application
|
||||
var metadata runtime.ServerMetadata
|
||||
@@ -516,6 +551,35 @@ func RegisterApplicationServiceHandlerClient(ctx context.Context, mux *runtime.S
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_ApplicationService_GetManifests_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_GetManifests_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_GetManifests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_ApplicationService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -731,6 +795,8 @@ var (
|
||||
|
||||
pattern_ApplicationService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "applications", "name"}, ""))
|
||||
|
||||
pattern_ApplicationService_GetManifests_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", "appName", "manifests"}, ""))
|
||||
|
||||
pattern_ApplicationService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "applications", "metadata.name"}, ""))
|
||||
|
||||
pattern_ApplicationService_UpdateSpec_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", "appName", "spec"}, ""))
|
||||
@@ -755,6 +821,8 @@ var (
|
||||
|
||||
forward_ApplicationService_Get_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ApplicationService_GetManifests_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ApplicationService_Update_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ApplicationService_UpdateSpec_0 = runtime.ForwardResponseMessage
|
||||
|
||||
@@ -11,6 +11,7 @@ import "google/api/annotations.proto";
|
||||
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";
|
||||
|
||||
|
||||
// ApplicationQuery is a query for application resources
|
||||
@@ -18,6 +19,12 @@ message ApplicationQuery {
|
||||
optional string name = 1;
|
||||
}
|
||||
|
||||
// ManifestQuery is a query for manifest resources
|
||||
message ManifestQuery {
|
||||
required string appName = 1;
|
||||
optional string revision = 2;
|
||||
}
|
||||
|
||||
message ApplicationResponse {}
|
||||
|
||||
message DeleteApplicationRequest {
|
||||
@@ -92,6 +99,11 @@ service ApplicationService {
|
||||
option (google.api.http).get = "/api/v1/applications/{name}";
|
||||
}
|
||||
|
||||
// GetManifests returns application manifests
|
||||
rpc GetManifests(ManifestQuery) returns (repository.ManifestResponse) {
|
||||
option (google.api.http).get = "/api/v1/applications/{appName}/manifests";
|
||||
}
|
||||
|
||||
// Update updates an application
|
||||
rpc Update(github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
||||
option (google.api.http) = {
|
||||
|
||||
@@ -259,7 +259,7 @@ func (f *Fixture) CreateController() *controller.ApplicationController {
|
||||
&controller.ApplicationControllerConfig{Namespace: f.Namespace, InstanceID: f.InstanceID})
|
||||
}
|
||||
|
||||
func (f *Fixture) NewApiClientset() (argocdclient.ServerClient, error) {
|
||||
func (f *Fixture) NewApiClientset() (argocdclient.Client, error) {
|
||||
return argocdclient.NewClient(&argocdclient.ClientOptions{
|
||||
Insecure: true,
|
||||
PlainText: true,
|
||||
|
||||
28
util/util.go
28
util/util.go
@@ -1,5 +1,9 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Closer interface {
|
||||
Close() error
|
||||
}
|
||||
@@ -9,3 +13,27 @@ type Closer interface {
|
||||
func Close(c Closer) {
|
||||
_ = c.Close()
|
||||
}
|
||||
|
||||
// Wait takes a check interval and timeout and waits for a function to return `true`.
|
||||
// Wait will return `true` on success and `false` on timeout.
|
||||
// The passed function, in turn, should pass `true` (or anything, really) to the channel when it's done.
|
||||
// Pass `0` as the timeout to run infinitely until completion.
|
||||
func Wait(timeout uint, f func(chan<- bool)) bool {
|
||||
done := make(chan bool)
|
||||
go f(done)
|
||||
|
||||
// infinite
|
||||
if timeout == 0 {
|
||||
return <-done
|
||||
}
|
||||
|
||||
timedOut := time.After(time.Duration(timeout) * time.Second)
|
||||
for {
|
||||
select {
|
||||
case <-done:
|
||||
return true
|
||||
case <-timedOut:
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user