Skip to content

Commit

Permalink
Merge branch 'appset-resource-events' of https://github.com/alexymant…
Browse files Browse the repository at this point in the history
  • Loading branch information
reggie-k committed Mar 31, 2024
2 parents 77f381a + 8fe019e commit 99b91ab
Show file tree
Hide file tree
Showing 16 changed files with 2,243 additions and 843 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ start: test-tools-image

# Starts a local instance of ArgoCD
.PHONY: start-local
start-local: mod-vendor-local dep-ui-local cli-local
start-local: mod-vendor-local start-local-fast

# Starts a local instance of ArgoCD without vendoring dependencies
.PHONY: start-local-fast
start-local-fast: dep-ui-local cli-local
# check we can connect to Docker to start Redis
killall goreman || true
kubectl create ns argocd || true
Expand Down
80 changes: 80 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4001,6 +4001,74 @@
}
}
},
"/api/v1/stream/applicationsets": {
"get": {
"tags": [
"ApplicationSetService"
],
"summary": "Watch returns stream of applicationset change events",
"operationId": "ApplicationSetService_Watch",
"parameters": [
{
"type": "string",
"description": "the applicationsets's name.",
"name": "name",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi",
"description": "the project names to restrict returned list applicationsets.",
"name": "projects",
"in": "query"
},
{
"type": "string",
"description": "the selector to restrict returned list to applicationsets only with matched labels.",
"name": "selector",
"in": "query"
},
{
"type": "string",
"description": "The application set namespace. Default empty is argocd control plane namespace.",
"name": "appsetNamespace",
"in": "query"
},
{
"type": "string",
"description": "when specified with a watch call, shows changes that occur after that particular version of a resource.",
"name": "resourceVersion",
"in": "query"
}
],
"responses": {
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"type": "object",
"title": "Stream result of v1alpha1ApplicationSetWatchEvent",
"properties": {
"error": {
"$ref": "#/definitions/runtimeStreamError"
},
"result": {
"$ref": "#/definitions/v1alpha1ApplicationSetWatchEvent"
}
}
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/api/version": {
"get": {
"tags": [
Expand Down Expand Up @@ -6276,6 +6344,18 @@
}
}
},
"v1alpha1ApplicationSetWatchEvent": {
"description": "ApplicationSetWatchEvent contains information about applicationset change.",
"type": "object",
"properties": {
"applicationSet": {
"$ref": "#/definitions/v1alpha1ApplicationSet"
},
"type": {
"type": "string"
}
}
},
"v1alpha1ApplicationSource": {
"type": "object",
"title": "ApplicationSource contains all required information about the source of an application",
Expand Down
551 changes: 508 additions & 43 deletions pkg/apiclient/applicationset/applicationset.pb.go

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions pkg/apiclient/applicationset/applicationset.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions pkg/apis/application/v1alpha1/applicationset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/watch"
)

// Utility struct for a reference to a secret key.
Expand Down Expand Up @@ -835,6 +836,18 @@ type ApplicationSetApplicationStatus struct {
Step string `json:"step" protobuf:"bytes,5,opt,name=step"`
}

// ApplicationSetWatchEvent contains information about applicationset change.
type ApplicationSetWatchEvent struct {
Type watch.EventType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=k8s.io/apimachinery/pkg/watch.EventType"`

// ApplicationSet is:
// * If Type is Added or Modified: the new state of the object.
// * If Type is Deleted: the state of the object immediately before deletion.
// * If Type is Error: *api.Status is recommended; other types may make sense
// depending on context.
ApplicationSet ApplicationSet `json:"applicationSet" protobuf:"bytes,2,opt,name=applicationSet"`
}

// ApplicationSetList contains a list of ApplicationSet
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
Expand Down
Loading

0 comments on commit 99b91ab

Please sign in to comment.