From 5a178982fe3f109d38b4bd9a6429dd15103f884b Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Tue, 28 May 2024 13:45:01 +0530 Subject: [PATCH 1/8] feat: notifier behind nats --- client/events/EventClient.go | 25 +- client/events/event_test.go | 37 + go.mod | 2 +- go.sum | 4 +- .../argoproj/argo-cd/assets/badge.svg | 22 - .../argo-cd/assets/builtin-policy.csv | 34 - .../argoproj/argo-cd/assets/model.conf | 14 - .../argoproj/argo-cd/assets/swagger.json | 3887 ----------------- .../blob-storage/BlobStorageService.go | 3 +- .../common-lib/constants/constants.go | 22 - .../common-lib/middlewares/recovery.go | 2 - .../common-lib/pubsub-lib/JetStreamUtil.go | 24 +- .../common-lib/pubsub-lib/NatsClient.go | 8 +- .../pubsub-lib/PubSubClientService.go | 40 +- .../common-lib/pubsub-lib/metrics/metrics.go | 32 +- .../common-lib/utils/CommonUtils.go | 13 - .../common-lib/utils/k8s/K8sUtil.go | 52 +- .../devtron-labs/common-lib/utils/k8s/bean.go | 8 +- .../common-lib/utils/k8s/commonBean/bean.go | 22 - .../utils/k8sObjectsUtil/DockerImageFinder.go | 121 - .../utils/k8sObjectsUtil/ImageUtil.go | 51 - .../utils/remoteConnection/bean/bean.go | 48 - vendor/modules.txt | 3 +- 23 files changed, 152 insertions(+), 4322 deletions(-) create mode 100644 client/events/event_test.go delete mode 100644 vendor/github.com/argoproj/argo-cd/assets/badge.svg delete mode 100644 vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv delete mode 100644 vendor/github.com/argoproj/argo-cd/assets/model.conf delete mode 100644 vendor/github.com/argoproj/argo-cd/assets/swagger.json delete mode 100644 vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go delete mode 100644 vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go delete mode 100644 vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go diff --git a/client/events/EventClient.go b/client/events/EventClient.go index 6558080145..fcd969fd9d 100644 --- a/client/events/EventClient.go +++ b/client/events/EventClient.go @@ -37,8 +37,12 @@ import ( ) type EventClientConfig struct { - DestinationURL string `env:"EVENT_URL" envDefault:"http://localhost:3000/notify"` + DestinationURL string `env:"EVENT_URL" envDefault:"http://localhost:3000/notify"` + NotificationMedium NotificationMedium `env:"NOTIFICATION_MEDIUM" envDefault:"rest"` } +type NotificationMedium string + +const PUB_SUB NotificationMedium = "nats" func GetEventClientConfig() (*EventClientConfig, error) { cfg := &EventClientConfig{} @@ -51,6 +55,7 @@ func GetEventClientConfig() (*EventClientConfig, error) { type EventClient interface { WriteNotificationEvent(event Event) (bool, error) + sendEventOnNats(event Event) WriteNatsEvent(channel string, payload interface{}) error } @@ -238,6 +243,16 @@ func (impl *EventRESTClientImpl) WriteNotificationEvent(event Event) (bool, erro } return true, err } +func (impl *EventRESTClientImpl) sendEventsOnNats(body []byte) error { + + err := impl.pubsubClient.Publish(pubsub.NOTIFICATION_EVENT_TOPIC, string(body)) + if err != nil { + impl.logger.Errorw("err while publishing msg for testing topic", "msg", body, "err", err) + return err + } + return nil + +} // do not call this method if notification module is not installed func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) { @@ -247,6 +262,14 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) { impl.logger.Errorw("error while marshaling event request ", "err", err) return false, err } + if impl.config.NotificationMedium == PUB_SUB { + err = impl.sendEventsOnNats(body) + if err != nil { + impl.logger.Errorw("error while publishing event ", "err", err) + return false, err + } + return true, nil + } var reqBody = []byte(body) req, err := http.NewRequest(http.MethodPost, impl.config.DestinationURL, bytes.NewBuffer(reqBody)) if err != nil { diff --git a/client/events/event_test.go b/client/events/event_test.go new file mode 100644 index 0000000000..a72f88f9cd --- /dev/null +++ b/client/events/event_test.go @@ -0,0 +1,37 @@ +package client + +import ( + "fmt" + pubsub_lib "github.com/devtron-labs/common-lib/pubsub-lib" + "github.com/devtron-labs/devtron/internal/sql/repository" + "github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig" + "github.com/devtron-labs/devtron/internal/util" + "github.com/devtron-labs/devtron/pkg/sql" + "testing" +) + +func TestSendEventsOnNats(t *testing.T) { + logger, err := util.NewSugardLogger() + //nats, err := pubsub_lib.NewNatsClient(logger) + //mockPubsubClient := NewPubSubClientServiceImpl(logger) + mockPubsubClient := pubsub_lib.NewPubSubClientServiceImpl(logger) + client := util.NewHttpClient() + config := sql.Config{} + db, err := sql.NewDbConnection(&config, logger) + trans := sql.NewTransactionUtilImpl(db) + impl := &EventRESTClientImpl{ + logger: logger, + pubsubClient: mockPubsubClient, + client: client, + config: &EventClientConfig{DestinationURL: "localhost:3000/notify", NotificationMedium: PUB_SUB}, + ciPipelineRepository: pipelineConfig.NewCiPipelineRepositoryImpl(db, logger, trans), + pipelineRepository: pipelineConfig.NewPipelineRepositoryImpl(db, logger), + attributesRepository: repository.NewAttributesRepositoryImpl(db), + } + //xpectedTopic := "NOTIFICATION_EVENT_TOPIC" + expectedMsg := "'{\"eventTypeId\":1,\"pipelineId\":123,\"payload\":{\"key\":\"value\"},\"eventTime\":\"2024-05-09T12:00:00Z\",\"appId\":456,\"envId\":789,\"teamId\":101}'" + + err = impl.sendEventsOnNats([]byte(expectedMsg)) + fmt.Println(err) + +} diff --git a/go.mod b/go.mod index a4ccb6f9d3..97868b1a19 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 - github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694 + github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8 github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 github.com/evanphx/json-patch v5.6.0+incompatible github.com/gammazero/workerpool v1.1.3 diff --git a/go.sum b/go.sum index 215c25546c..e62c2db1b2 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADG github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 h1:AUTYcDnL6w6Ux+264VldYaOUQAP6pDZ5Tq8wCKJyiEg= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470/go.mod h1:JQxTCMmQisrpjzETJr0tzVadV+wW23rHEZAY7JVyK3s= -github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694 h1:lUcMarRvAKzsLpmuYwFgOsKLJQpHsJuvbKG+we/dI58= -github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= +github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8 h1:xZhRjWZR7koFQZyt2obfpX6HxRrjiwXUXundPP05Pok= +github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8/go.mod h1:mzEk3pf4JDXsOPNvCxjoSnsMBTwmt4A73Qc2tobLkZM= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 h1:TElPRU69QedW7DIQiiQxtjwSQ6cK0fCTAMGvSLhP0ac= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534/go.mod h1:ypUknVph8Ph4dxSlrFoouf7wLedQxHku2LQwgRrdgS4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= diff --git a/vendor/github.com/argoproj/argo-cd/assets/badge.svg b/vendor/github.com/argoproj/argo-cd/assets/badge.svg deleted file mode 100644 index a3234cfdf5..0000000000 --- a/vendor/github.com/argoproj/argo-cd/assets/badge.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv b/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv deleted file mode 100644 index f74c5b8002..0000000000 --- a/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv +++ /dev/null @@ -1,34 +0,0 @@ -# Built-in policy which defines two roles: role:readonly and role:admin, -# and additionally assigns the admin user to the role:admin role. -# There are two policy formats: -# 1. Applications (which belong to a project): -# p, , , , / -# 2. All other resources: -# p, , , , - -p, role:readonly, applications, get, */*, allow -p, role:readonly, certificates, get, *, allow -p, role:readonly, clusters, get, *, allow -p, role:readonly, repositories, get, *, allow -p, role:readonly, projects, get, *, allow - -p, role:admin, applications, create, */*, allow -p, role:admin, applications, update, */*, allow -p, role:admin, applications, delete, */*, allow -p, role:admin, applications, sync, */*, allow -p, role:admin, applications, override, */*, allow -p, role:admin, certificates, create, *, allow -p, role:admin, certificates, update, *, allow -p, role:admin, certificates, delete, *, allow -p, role:admin, clusters, create, *, allow -p, role:admin, clusters, update, *, allow -p, role:admin, clusters, delete, *, allow -p, role:admin, repositories, create, *, allow -p, role:admin, repositories, update, *, allow -p, role:admin, repositories, delete, *, allow -p, role:admin, projects, create, *, allow -p, role:admin, projects, update, *, allow -p, role:admin, projects, delete, *, allow - -g, role:admin, role:readonly -g, admin, role:admin \ No newline at end of file diff --git a/vendor/github.com/argoproj/argo-cd/assets/model.conf b/vendor/github.com/argoproj/argo-cd/assets/model.conf deleted file mode 100644 index 240a9180d3..0000000000 --- a/vendor/github.com/argoproj/argo-cd/assets/model.conf +++ /dev/null @@ -1,14 +0,0 @@ -[request_definition] -r = sub, res, act, obj - -[policy_definition] -p = sub, res, act, obj, eft - -[role_definition] -g = _, _ - -[policy_effect] -e = some(where (p.eft == allow)) && !some(where (p.eft == deny)) - -[matchers] -m = g(r.sub, p.sub) && keyMatch(r.res, p.res) && keyMatch(r.act, p.act) && keyMatch(r.obj, p.obj) \ No newline at end of file diff --git a/vendor/github.com/argoproj/argo-cd/assets/swagger.json b/vendor/github.com/argoproj/argo-cd/assets/swagger.json deleted file mode 100644 index 0ad53c18de..0000000000 --- a/vendor/github.com/argoproj/argo-cd/assets/swagger.json +++ /dev/null @@ -1,3887 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http", - "https" - ], - "swagger": "2.0", - "info": { - "description": "Description of all APIs", - "title": "Consolidate Services", - "version": "version not set" - }, - "paths": { - "/api/v1/account/password": { - "put": { - "tags": [ - "AccountService" - ], - "summary": "UpdatePassword updates an account's password to a new value", - "operationId": "UpdatePassword", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/accountUpdatePasswordRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/accountUpdatePasswordResponse" - } - } - } - } - }, - "/api/v1/applications": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "List returns list of applications", - "operationId": "ListMixin6", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "query" - }, - { - "type": "string", - "name": "refresh", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "project", - "in": "query" - }, - { - "type": "string", - "name": "resourceVersion", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1ApplicationList" - } - } - } - }, - "post": { - "tags": [ - "ApplicationService" - ], - "summary": "Create creates an application", - "operationId": "CreateMixin6", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - } - } - }, - "/api/v1/applications/{application.metadata.name}": { - "put": { - "tags": [ - "ApplicationService" - ], - "summary": "Update updates an application", - "operationId": "UpdateMixin6", - "parameters": [ - { - "type": "string", - "name": "application.metadata.name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - } - } - }, - "/api/v1/applications/{applicationName}/managed-resources": { - "get": { - "tags": [ - "ApplicationService" - ], - "operationId": "ManagedResources", - "parameters": [ - { - "type": "string", - "name": "applicationName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationManagedResourcesResponse" - } - } - } - } - }, - "/api/v1/applications/{applicationName}/resource-tree": { - "get": { - "tags": [ - "ApplicationService" - ], - "operationId": "ResourceTree", - "parameters": [ - { - "type": "string", - "name": "applicationName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1ApplicationTree" - } - } - } - } - }, - "/api/v1/applications/{name}": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "Get returns an application by name", - "operationId": "GetMixin6", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "refresh", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "project", - "in": "query" - }, - { - "type": "string", - "name": "resourceVersion", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - } - }, - "delete": { - "tags": [ - "ApplicationService" - ], - "summary": "Delete deletes an application", - "operationId": "DeleteMixin6", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationApplicationResponse" - } - } - } - }, - "patch": { - "tags": [ - "ApplicationService" - ], - "summary": "Patch patch an application", - "operationId": "Patch", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/applicationApplicationPatchRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - } - } - }, - "/api/v1/applications/{name}/events": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "ListResourceEvents returns a list of event resources", - "operationId": "ListResourceEvents", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "resourceNamespace", - "in": "query" - }, - { - "type": "string", - "name": "resourceName", - "in": "query" - }, - { - "type": "string", - "name": "resourceUID", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1EventList" - } - } - } - } - }, - "/api/v1/applications/{name}/manifests": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "GetManifests returns application manifests", - "operationId": "GetManifests", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "revision", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/repositoryManifestResponse" - } - } - } - } - }, - "/api/v1/applications/{name}/operation": { - "delete": { - "tags": [ - "ApplicationService" - ], - "summary": "TerminateOperation terminates the currently running operation", - "operationId": "TerminateOperation", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationOperationTerminateResponse" - } - } - } - } - }, - "/api/v1/applications/{name}/pods/{podName}/logs": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "PodLogs returns stream of log entries for the specified pod. Pod", - "operationId": "PodLogs", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "podName", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "namespace", - "in": "query" - }, - { - "type": "string", - "name": "container", - "in": "query" - }, - { - "type": "string", - "format": "int64", - "name": "sinceSeconds", - "in": "query" - }, - { - "type": "string", - "format": "int64", - "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.", - "name": "sinceTime.seconds", - "in": "query" - }, - { - "type": "integer", - "format": "int32", - "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive. This field may be limited in precision depending on context.", - "name": "sinceTime.nanos", - "in": "query" - }, - { - "type": "string", - "format": "int64", - "name": "tailLines", - "in": "query" - }, - { - "type": "boolean", - "format": "boolean", - "name": "follow", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(streaming responses)", - "schema": { - "$ref": "#/definitions/applicationLogEntry" - } - } - } - } - }, - "/api/v1/applications/{name}/resource": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "GetResource returns single application resource", - "operationId": "GetResource", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "namespace", - "in": "query" - }, - { - "type": "string", - "name": "resourceName", - "in": "query" - }, - { - "type": "string", - "name": "version", - "in": "query" - }, - { - "type": "string", - "name": "group", - "in": "query" - }, - { - "type": "string", - "name": "kind", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationApplicationResourceResponse" - } - } - } - }, - "post": { - "tags": [ - "ApplicationService" - ], - "summary": "PatchResource patch single application resource", - "operationId": "PatchResource", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationApplicationResourceResponse" - } - } - } - }, - "delete": { - "tags": [ - "ApplicationService" - ], - "summary": "DeleteResource deletes a single application resource", - "operationId": "DeleteResource", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationApplicationResponse" - } - } - } - } - }, - "/api/v1/applications/{name}/resource/actions": { - "get": { - "tags": [ - "ApplicationService" - ], - "operationId": "ListResourceActions", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "namespace", - "in": "query" - }, - { - "type": "string", - "name": "resourceName", - "in": "query" - }, - { - "type": "string", - "name": "version", - "in": "query" - }, - { - "type": "string", - "name": "group", - "in": "query" - }, - { - "type": "string", - "name": "kind", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationResourceActionsListResponse" - } - } - } - }, - "post": { - "tags": [ - "ApplicationService" - ], - "operationId": "RunResourceAction", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/applicationApplicationResponse" - } - } - } - } - }, - "/api/v1/applications/{name}/revisions/{revision}/metadata": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "Get the meta-data (author, date, tags, message) for a specific revision of the application", - "operationId": "RevisionMetadata", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "revision", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1RevisionMetadata" - } - } - } - } - }, - "/api/v1/applications/{name}/rollback": { - "post": { - "tags": [ - "ApplicationService" - ], - "summary": "Rollback syncs an application to its target state", - "operationId": "Rollback", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/applicationApplicationRollbackRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - } - } - }, - "/api/v1/applications/{name}/spec": { - "put": { - "tags": [ - "ApplicationService" - ], - "summary": "UpdateSpec updates an application spec", - "operationId": "UpdateSpec", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1ApplicationSpec" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1ApplicationSpec" - } - } - } - } - }, - "/api/v1/applications/{name}/sync": { - "post": { - "tags": [ - "ApplicationService" - ], - "summary": "Sync syncs an application to its target state", - "operationId": "Sync", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/applicationApplicationSyncRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Application" - } - } - } - } - }, - "/api/v1/certificates": { - "get": { - "tags": [ - "CertificateService" - ], - "summary": "List all available repository certificates", - "operationId": "ListCertificates", - "parameters": [ - { - "type": "string", - "description": "A file-glob pattern (not regular expression) the host name has to match.", - "name": "hostNamePattern", - "in": "query" - }, - { - "type": "string", - "description": "The type of the certificate to match (ssh or https).", - "name": "certType", - "in": "query" - }, - { - "type": "string", - "description": "The sub type of the certificate to match (protocol dependent, usually only used for ssh certs).", - "name": "certSubType", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1RepositoryCertificateList" - } - } - } - }, - "post": { - "tags": [ - "CertificateService" - ], - "summary": "Creates repository certificates on the server", - "operationId": "CreateCertificate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1RepositoryCertificateList" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1RepositoryCertificateList" - } - } - } - }, - "delete": { - "tags": [ - "CertificateService" - ], - "summary": "Delete the certificates that match the RepositoryCertificateQuery", - "operationId": "DeleteCertificate", - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1RepositoryCertificateList" - } - } - } - } - }, - "/api/v1/clusters": { - "get": { - "tags": [ - "ClusterService" - ], - "summary": "List returns list of clusters", - "operationId": "List", - "parameters": [ - { - "type": "string", - "name": "server", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1ClusterList" - } - } - } - }, - "post": { - "tags": [ - "ClusterService" - ], - "summary": "Create creates a cluster", - "operationId": "Create", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1Cluster" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Cluster" - } - } - } - } - }, - "/api/v1/clusters/{cluster.server}": { - "put": { - "tags": [ - "ClusterService" - ], - "summary": "Update updates a cluster", - "operationId": "Update", - "parameters": [ - { - "type": "string", - "name": "cluster.server", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1Cluster" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Cluster" - } - } - } - } - }, - "/api/v1/clusters/{server}": { - "get": { - "tags": [ - "ClusterService" - ], - "summary": "Get returns a cluster by server address", - "operationId": "GetMixin1", - "parameters": [ - { - "type": "string", - "name": "server", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Cluster" - } - } - } - }, - "delete": { - "tags": [ - "ClusterService" - ], - "summary": "Delete deletes a cluster", - "operationId": "Delete", - "parameters": [ - { - "type": "string", - "name": "server", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/clusterClusterResponse" - } - } - } - } - }, - "/api/v1/clusters/{server}/rotate-auth": { - "post": { - "tags": [ - "ClusterService" - ], - "summary": "RotateAuth returns a cluster by server address", - "operationId": "RotateAuth", - "parameters": [ - { - "type": "string", - "name": "server", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/clusterClusterResponse" - } - } - } - } - }, - "/api/v1/projects": { - "get": { - "tags": [ - "ProjectService" - ], - "summary": "List returns list of projects", - "operationId": "ListMixin4", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1AppProjectList" - } - } - } - }, - "post": { - "tags": [ - "ProjectService" - ], - "summary": "Create a new project.", - "operationId": "CreateMixin4", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/projectProjectCreateRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1AppProject" - } - } - } - } - }, - "/api/v1/projects/{name}": { - "get": { - "tags": [ - "ProjectService" - ], - "summary": "Get returns a project by name", - "operationId": "GetMixin4", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1AppProject" - } - } - } - }, - "delete": { - "tags": [ - "ProjectService" - ], - "summary": "Delete deletes a project", - "operationId": "DeleteMixin4", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/projectEmptyResponse" - } - } - } - } - }, - "/api/v1/projects/{name}/events": { - "get": { - "tags": [ - "ProjectService" - ], - "summary": "ListEvents returns a list of project events", - "operationId": "ListEvents", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1EventList" - } - } - } - } - }, - "/api/v1/projects/{project.metadata.name}": { - "put": { - "tags": [ - "ProjectService" - ], - "summary": "Update updates a project", - "operationId": "UpdateMixin4", - "parameters": [ - { - "type": "string", - "name": "project.metadata.name", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/projectProjectUpdateRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1AppProject" - } - } - } - } - }, - "/api/v1/projects/{project}/roles/{role}/token": { - "post": { - "tags": [ - "ProjectService" - ], - "summary": "Create a new project token.", - "operationId": "CreateToken", - "parameters": [ - { - "type": "string", - "name": "project", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "role", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/projectProjectTokenCreateRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/projectProjectTokenResponse" - } - } - } - } - }, - "/api/v1/projects/{project}/roles/{role}/token/{iat}": { - "delete": { - "tags": [ - "ProjectService" - ], - "summary": "Delete a new project token.", - "operationId": "DeleteToken", - "parameters": [ - { - "type": "string", - "name": "project", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "role", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "int64", - "name": "iat", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/projectEmptyResponse" - } - } - } - } - }, - "/api/v1/repositories": { - "get": { - "tags": [ - "RepositoryService" - ], - "summary": "List returns list of repos", - "operationId": "ListMixin2", - "parameters": [ - { - "type": "string", - "name": "repo", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1RepositoryList" - } - } - } - }, - "post": { - "tags": [ - "RepositoryService" - ], - "summary": "Create creates a repo", - "operationId": "CreateMixin2", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1Repository" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Repository" - } - } - } - } - }, - "/api/v1/repositories/{repo.repo}": { - "put": { - "tags": [ - "RepositoryService" - ], - "summary": "Update updates a repo", - "operationId": "UpdateMixin2", - "parameters": [ - { - "type": "string", - "name": "repo.repo", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1Repository" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/v1alpha1Repository" - } - } - } - } - }, - "/api/v1/repositories/{repo}": { - "delete": { - "tags": [ - "RepositoryService" - ], - "summary": "Delete deletes a repo", - "operationId": "DeleteMixin2", - "parameters": [ - { - "type": "string", - "name": "repo", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/repositoryRepoResponse" - } - } - } - } - }, - "/api/v1/repositories/{repo}/apps": { - "get": { - "tags": [ - "RepositoryService" - ], - "summary": "ListApps returns list of apps in the repo", - "operationId": "ListApps", - "parameters": [ - { - "type": "string", - "name": "repo", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "revision", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/repositoryRepoAppsResponse" - } - } - } - } - }, - "/api/v1/repositories/{repo}/apps/{path}": { - "get": { - "tags": [ - "RepositoryService" - ], - "summary": "GetAppDetails returns application details by given path", - "operationId": "GetAppDetails", - "parameters": [ - { - "type": "string", - "name": "repo", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "path", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "revision", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "helm.valueFiles", - "in": "query" - }, - { - "type": "string", - "name": "ksonnet.environment", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/repositoryRepoAppDetailsResponse" - } - } - } - } - }, - "/api/v1/repositories/{repo}/validate": { - "post": { - "tags": [ - "RepositoryService" - ], - "summary": "ValidateAccess validates access to a repository with given parameters", - "operationId": "ValidateAccess", - "parameters": [ - { - "type": "string", - "name": "repo", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/repositoryRepoResponse" - } - } - } - } - }, - "/api/v1/session": { - "post": { - "tags": [ - "SessionService" - ], - "summary": "Create a new JWT for authentication and set a cookie if using HTTP.", - "operationId": "CreateMixin8", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/sessionSessionCreateRequest" - } - } - ], - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/sessionSessionResponse" - } - } - } - }, - "delete": { - "tags": [ - "SessionService" - ], - "summary": "Delete an existing JWT cookie if using HTTP.", - "operationId": "DeleteMixin8", - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/sessionSessionResponse" - } - } - } - } - }, - "/api/v1/settings": { - "get": { - "tags": [ - "SettingsService" - ], - "summary": "Get returns Argo CD settings", - "operationId": "Get", - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/clusterSettings" - } - } - } - } - }, - "/api/v1/stream/applications": { - "get": { - "tags": [ - "ApplicationService" - ], - "summary": "Watch returns stream of application change events.", - "operationId": "Watch", - "parameters": [ - { - "type": "string", - "name": "name", - "in": "query" - }, - { - "type": "string", - "name": "refresh", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "project", - "in": "query" - }, - { - "type": "string", - "name": "resourceVersion", - "in": "query" - } - ], - "responses": { - "200": { - "description": "(streaming responses)", - "schema": { - "$ref": "#/definitions/v1alpha1ApplicationWatchEvent" - } - } - } - } - }, - "/api/version": { - "get": { - "tags": [ - "VersionService" - ], - "summary": "Version returns version information of the API server", - "operationId": "Version", - "responses": { - "200": { - "description": "(empty)", - "schema": { - "$ref": "#/definitions/versionVersionMessage" - } - } - } - } - } - }, - "definitions": { - "accountUpdatePasswordRequest": { - "type": "object", - "properties": { - "currentPassword": { - "type": "string" - }, - "newPassword": { - "type": "string" - } - } - }, - "accountUpdatePasswordResponse": { - "type": "object" - }, - "applicationApplicationPatchRequest": { - "type": "object", - "title": "ApplicationPatchRequest is a request to patch an application", - "properties": { - "name": { - "type": "string" - }, - "patch": { - "type": "string" - }, - "patchType": { - "type": "string" - } - } - }, - "applicationApplicationResourceResponse": { - "type": "object", - "properties": { - "manifest": { - "type": "string" - } - } - }, - "applicationApplicationResponse": { - "type": "object" - }, - "applicationApplicationRollbackRequest": { - "type": "object", - "properties": { - "dryRun": { - "type": "boolean", - "format": "boolean" - }, - "id": { - "type": "string", - "format": "int64" - }, - "name": { - "type": "string" - }, - "prune": { - "type": "boolean", - "format": "boolean" - } - } - }, - "applicationApplicationSyncRequest": { - "type": "object", - "title": "ApplicationSyncRequest is a request to apply the config state to live state", - "properties": { - "dryRun": { - "type": "boolean", - "format": "boolean" - }, - "manifests": { - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "type": "string" - }, - "prune": { - "type": "boolean", - "format": "boolean" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1SyncOperationResource" - } - }, - "revision": { - "type": "string" - }, - "strategy": { - "$ref": "#/definitions/v1alpha1SyncStrategy" - } - } - }, - "applicationLogEntry": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "timeStamp": { - "$ref": "#/definitions/v1Time" - } - } - }, - "applicationManagedResourcesResponse": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ResourceDiff" - } - } - } - }, - "applicationOperationTerminateResponse": { - "type": "object" - }, - "applicationResourceActionsListResponse": { - "type": "object", - "properties": { - "actions": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ResourceAction" - } - } - } - }, - "clusterClusterResponse": { - "type": "object" - }, - "clusterConnector": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "clusterDexConfig": { - "type": "object", - "properties": { - "connectors": { - "type": "array", - "items": { - "$ref": "#/definitions/clusterConnector" - } - } - } - }, - "clusterGoogleAnalyticsConfig": { - "type": "object", - "properties": { - "anonymizeUsers": { - "type": "boolean", - "format": "boolean" - }, - "trackingID": { - "type": "string" - } - } - }, - "clusterHelp": { - "type": "object", - "title": "Help settings", - "properties": { - "chatText": { - "type": "string", - "title": "the text for getting chat help, defaults to \"Chat now!\"" - }, - "chatUrl": { - "type": "string", - "title": "the URL for getting chat help, this will typically be your Slack channel for support" - } - } - }, - "clusterOIDCConfig": { - "type": "object", - "properties": { - "cliClientID": { - "type": "string" - }, - "clientID": { - "type": "string" - }, - "issuer": { - "type": "string" - }, - "name": { - "type": "string" - }, - "scopes": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "clusterSettings": { - "type": "object", - "properties": { - "appLabelKey": { - "type": "string" - }, - "dexConfig": { - "$ref": "#/definitions/clusterDexConfig" - }, - "googleAnalytics": { - "$ref": "#/definitions/clusterGoogleAnalyticsConfig" - }, - "help": { - "$ref": "#/definitions/clusterHelp" - }, - "kustomizeOptions": { - "$ref": "#/definitions/v1alpha1KustomizeOptions" - }, - "oidcConfig": { - "$ref": "#/definitions/clusterOIDCConfig" - }, - "resourceOverrides": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1alpha1ResourceOverride" - } - }, - "statusBadgeEnabled": { - "type": "boolean", - "format": "boolean" - }, - "url": { - "type": "string" - } - } - }, - "projectEmptyResponse": { - "type": "object" - }, - "projectProjectCreateRequest": { - "description": "ProjectCreateRequest defines project creation parameters.", - "type": "object", - "properties": { - "project": { - "$ref": "#/definitions/v1alpha1AppProject" - } - } - }, - "projectProjectTokenCreateRequest": { - "description": "ProjectTokenCreateRequest defines project token creation parameters.", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "expiresIn": { - "type": "string", - "format": "int64", - "title": "expiresIn represents a duration in seconds" - }, - "project": { - "type": "string" - }, - "role": { - "type": "string" - } - } - }, - "projectProjectTokenResponse": { - "description": "ProjectTokenResponse wraps the created token or returns an empty string if deleted.", - "type": "object", - "properties": { - "token": { - "type": "string" - } - } - }, - "projectProjectUpdateRequest": { - "type": "object", - "properties": { - "project": { - "$ref": "#/definitions/v1alpha1AppProject" - } - } - }, - "repositoryAppInfo": { - "type": "object", - "title": "AppInfo contains application type and app file path", - "properties": { - "path": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "repositoryDirectoryAppSpec": { - "type": "object", - "title": "DirectoryAppSpec contains directory" - }, - "repositoryHelmAppDetailsQuery": { - "type": "object", - "properties": { - "valueFiles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "repositoryHelmAppSpec": { - "type": "object", - "title": "HelmAppSpec contains helm app name and path in source repo", - "properties": { - "name": { - "type": "string" - }, - "parameters": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1HelmParameter" - } - }, - "path": { - "type": "string" - }, - "valueFiles": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "repositoryKsonnetAppDetailsQuery": { - "type": "object", - "properties": { - "environment": { - "type": "string" - } - } - }, - "repositoryKsonnetAppSpec": { - "type": "object", - "title": "KsonnetAppSpec contains Ksonnet app response\nThis roughly reflects: ksonnet/ksonnet/metadata/app/schema.go", - "properties": { - "environments": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/repositoryKsonnetEnvironment" - } - }, - "name": { - "type": "string" - }, - "parameters": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1KsonnetParameter" - } - }, - "path": { - "type": "string" - } - } - }, - "repositoryKsonnetEnvironment": { - "type": "object", - "properties": { - "destination": { - "$ref": "#/definitions/repositoryKsonnetEnvironmentDestination" - }, - "k8sVersion": { - "description": "KubernetesVersion is the kubernetes version the targetted cluster is running on.", - "type": "string" - }, - "name": { - "type": "string", - "title": "Name is the user defined name of an environment" - }, - "path": { - "description": "Path is the relative project path containing metadata for this environment.", - "type": "string" - } - } - }, - "repositoryKsonnetEnvironmentDestination": { - "type": "object", - "properties": { - "namespace": { - "type": "string", - "title": "Namespace is the namespace of the Kubernetes server that targets should be deployed to" - }, - "server": { - "description": "Server is the Kubernetes server that the cluster is running on.", - "type": "string" - } - } - }, - "repositoryKustomizeAppSpec": { - "type": "object", - "title": "KustomizeAppSpec contains kustomize app name and path in source repo", - "properties": { - "images": { - "description": "images is a list of available images.", - "type": "array", - "items": { - "type": "string" - } - }, - "path": { - "type": "string" - } - } - }, - "repositoryManifestResponse": { - "type": "object", - "properties": { - "manifests": { - "type": "array", - "items": { - "type": "string" - } - }, - "namespace": { - "type": "string" - }, - "revision": { - "type": "string" - }, - "server": { - "type": "string" - }, - "sourceType": { - "type": "string" - } - } - }, - "repositoryRepoAppDetailsResponse": { - "type": "object", - "title": "RepoAppDetailsResponse application details", - "properties": { - "directory": { - "$ref": "#/definitions/repositoryDirectoryAppSpec" - }, - "helm": { - "$ref": "#/definitions/repositoryHelmAppSpec" - }, - "ksonnet": { - "$ref": "#/definitions/repositoryKsonnetAppSpec" - }, - "kustomize": { - "$ref": "#/definitions/repositoryKustomizeAppSpec" - }, - "type": { - "type": "string" - } - } - }, - "repositoryRepoAppsResponse": { - "type": "object", - "title": "RepoAppsResponse contains applications of specified repository", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/repositoryAppInfo" - } - } - } - }, - "repositoryRepoResponse": { - "type": "object" - }, - "sessionSessionCreateRequest": { - "description": "SessionCreateRequest is for logging in.", - "type": "object", - "properties": { - "password": { - "type": "string" - }, - "token": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "sessionSessionResponse": { - "description": "SessionResponse wraps the created token or returns an empty string if deleted.", - "type": "object", - "properties": { - "token": { - "type": "string" - } - } - }, - "v1Event": { - "description": "Event is a report of an event somewhere in the cluster.", - "type": "object", - "properties": { - "action": { - "type": "string", - "title": "What action was taken/failed regarding to the Regarding object.\n+optional" - }, - "count": { - "type": "integer", - "format": "int32", - "title": "The number of times this event has occurred.\n+optional" - }, - "eventTime": { - "$ref": "#/definitions/v1MicroTime" - }, - "firstTimestamp": { - "$ref": "#/definitions/v1Time" - }, - "involvedObject": { - "$ref": "#/definitions/v1ObjectReference" - }, - "lastTimestamp": { - "$ref": "#/definitions/v1Time" - }, - "message": { - "type": "string", - "title": "A human-readable description of the status of this operation.\nTODO: decide on maximum length.\n+optional" - }, - "metadata": { - "$ref": "#/definitions/v1ObjectMeta" - }, - "reason": { - "type": "string", - "title": "This should be a short, machine understandable string that gives the reason\nfor the transition into the object's current status.\nTODO: provide exact specification for format.\n+optional" - }, - "related": { - "$ref": "#/definitions/v1ObjectReference" - }, - "reportingComponent": { - "type": "string", - "title": "Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.\n+optional" - }, - "reportingInstance": { - "type": "string", - "title": "ID of the controller instance, e.g. `kubelet-xyzf`.\n+optional" - }, - "series": { - "$ref": "#/definitions/v1EventSeries" - }, - "source": { - "$ref": "#/definitions/v1EventSource" - }, - "type": { - "type": "string", - "title": "Type of this event (Normal, Warning), new types could be added in the future\n+optional" - } - } - }, - "v1EventList": { - "description": "EventList is a list of events.", - "type": "object", - "properties": { - "items": { - "type": "array", - "title": "List of events", - "items": { - "$ref": "#/definitions/v1Event" - } - }, - "metadata": { - "$ref": "#/definitions/v1ListMeta" - } - } - }, - "v1EventSeries": { - "description": "EventSeries contain information on series of events, i.e. thing that was/is happening\ncontinuously for some time.", - "type": "object", - "properties": { - "count": { - "type": "integer", - "format": "int32", - "title": "Number of occurrences in this series up to the last heartbeat time" - }, - "lastObservedTime": { - "$ref": "#/definitions/v1MicroTime" - }, - "state": { - "type": "string", - "title": "State of this Series: Ongoing or Finished" - } - } - }, - "v1EventSource": { - "description": "EventSource contains information for an event.", - "type": "object", - "properties": { - "component": { - "type": "string", - "title": "Component from which the event is generated.\n+optional" - }, - "host": { - "type": "string", - "title": "Node name on which the event is generated.\n+optional" - } - } - }, - "v1Fields": { - "type": "object", - "title": "Fields stores a set of fields in a data structure like a Trie.\nTo understand how this is used, see: https://github.com/kubernetes-sigs/structured-merge-diff", - "properties": { - "map": { - "description": "Map stores a set of fields in a data structure like a Trie.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set,\nor a string representing a sub-field or item. The string will follow one of these four formats:\n'f:', where is the name of a field in a struct, or key in a map\n'v:', where is the exact json formatted value of a list item\n'i:', where is position of a item in a list\n'k:', where is a map of a list item's key fields to their unique values\nIf a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/v1Fields" - } - } - } - }, - "v1GroupKind": { - "description": "+protobuf.options.(gogoproto.goproto_stringer)=false", - "type": "object", - "title": "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying\nconcepts during lookup stages without having partially valid types", - "properties": { - "group": { - "type": "string" - }, - "kind": { - "type": "string" - } - } - }, - "v1Initializer": { - "description": "Initializer is information about an initializer that has not yet completed.", - "type": "object", - "properties": { - "name": { - "description": "name of the process that is responsible for initializing this object.", - "type": "string" - } - } - }, - "v1Initializers": { - "description": "Initializers tracks the progress of initialization.", - "type": "object", - "properties": { - "pending": { - "type": "array", - "title": "Pending is a list of initializers that must execute in order before this object is visible.\nWhen the last pending initializer is removed, and no failing result is set, the initializers\nstruct will be set to nil and the object is considered as initialized and visible to all\nclients.\n+patchMergeKey=name\n+patchStrategy=merge", - "items": { - "$ref": "#/definitions/v1Initializer" - } - }, - "result": { - "$ref": "#/definitions/v1Status" - } - } - }, - "v1ListMeta": { - "description": "ListMeta describes metadata that synthetic resources must have, including lists and\nvarious status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - "type": "object", - "properties": { - "continue": { - "description": "continue may be set if the user set a limit on the number of items returned, and indicates that\nthe server has more data available. The value is opaque and may be used to issue another request\nto the endpoint that served this list to retrieve the next set of available objects. Continuing a\nconsistent list may not be possible if the server configuration has changed or more than a few\nminutes have passed. The resourceVersion field returned when using this continue value will be\nidentical to the value in the first response, unless you have received this token from an error\nmessage.", - "type": "string" - }, - "resourceVersion": { - "type": "string", - "title": "String that identifies the server's internal version of this object that\ncan be used by clients to determine when objects have changed.\nValue must be treated as opaque by clients and passed unmodified back to the server.\nPopulated by the system.\nRead-only.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency\n+optional" - }, - "selfLink": { - "type": "string", - "title": "selfLink is a URL representing this object.\nPopulated by the system.\nRead-only.\n+optional" - } - } - }, - "v1LoadBalancerIngress": { - "description": "LoadBalancerIngress represents the status of a load-balancer ingress point:\ntraffic intended for the service should be sent to an ingress point.", - "type": "object", - "properties": { - "hostname": { - "type": "string", - "title": "Hostname is set for load-balancer ingress points that are DNS based\n(typically AWS load-balancers)\n+optional" - }, - "ip": { - "type": "string", - "title": "IP is set for load-balancer ingress points that are IP based\n(typically GCE or OpenStack load-balancers)\n+optional" - } - } - }, - "v1ManagedFieldsEntry": { - "description": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource\nthat the fieldset applies to.", - "type": "object", - "properties": { - "apiVersion": { - "description": "APIVersion defines the version of this resource that this field set\napplies to. The format is \"group/version\" just like the top-level\nAPIVersion field. It is necessary to track the version of a field\nset because it cannot be automatically converted.", - "type": "string" - }, - "fields": { - "$ref": "#/definitions/v1Fields" - }, - "manager": { - "description": "Manager is an identifier of the workflow managing these fields.", - "type": "string" - }, - "operation": { - "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created.\nThe only valid values for this field are 'Apply' and 'Update'.", - "type": "string" - }, - "time": { - "$ref": "#/definitions/v1Time" - } - } - }, - "v1MicroTime": { - "description": "MicroTime is version of Time with microsecond level precision.\n\n+protobuf.options.marshal=false\n+protobuf.as=Timestamp\n+protobuf.options.(gogoproto.goproto_stringer)=false", - "type": "object", - "properties": { - "nanos": { - "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive. This field may be limited in precision depending on context.", - "type": "integer", - "format": "int32" - }, - "seconds": { - "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.", - "type": "string", - "format": "int64" - } - } - }, - "v1ObjectMeta": { - "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects\nusers must create.", - "type": "object", - "properties": { - "annotations": { - "type": "object", - "title": "Annotations is an unstructured key value map stored with a resource that may be\nset by external tools to store and retrieve arbitrary metadata. They are not\nqueryable and should be preserved when modifying objects.\nMore info: http://kubernetes.io/docs/user-guide/annotations\n+optional", - "additionalProperties": { - "type": "string" - } - }, - "clusterName": { - "type": "string", - "title": "The name of the cluster which the object belongs to.\nThis is used to distinguish resources with same name and namespace in different clusters.\nThis field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.\n+optional" - }, - "creationTimestamp": { - "$ref": "#/definitions/v1Time" - }, - "deletionGracePeriodSeconds": { - "type": "string", - "format": "int64", - "title": "Number of seconds allowed for this object to gracefully terminate before\nit will be removed from the system. Only set when deletionTimestamp is also set.\nMay only be shortened.\nRead-only.\n+optional" - }, - "deletionTimestamp": { - "$ref": "#/definitions/v1Time" - }, - "finalizers": { - "type": "array", - "title": "Must be empty before the object is deleted from the registry. Each entry\nis an identifier for the responsible component that will remove the entry\nfrom the list. If the deletionTimestamp of the object is non-nil, entries\nin this list can only be removed.\n+optional\n+patchStrategy=merge", - "items": { - "type": "string" - } - }, - "generateName": { - "description": "GenerateName is an optional prefix, used by the server, to generate a unique\nname ONLY IF the Name field has not been provided.\nIf this field is used, the name returned to the client will be different\nthan the name passed. This value will also be combined with a unique suffix.\nThe provided value has the same validation rules as the Name field,\nand may be truncated by the length of the suffix required to make the value\nunique on the server.\n\nIf this field is specified and the generated name exists, the server will\nNOT return a 409 - instead, it will either return 201 Created or 500 with Reason\nServerTimeout indicating a unique name could not be found in the time allotted, and the client\nshould retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency\n+optional", - "type": "string" - }, - "generation": { - "type": "string", - "format": "int64", - "title": "A sequence number representing a specific generation of the desired state.\nPopulated by the system. Read-only.\n+optional" - }, - "initializers": { - "$ref": "#/definitions/v1Initializers" - }, - "labels": { - "type": "object", - "title": "Map of string keys and values that can be used to organize and categorize\n(scope and select) objects. May match selectors of replication controllers\nand services.\nMore info: http://kubernetes.io/docs/user-guide/labels\n+optional", - "additionalProperties": { - "type": "string" - } - }, - "managedFields": { - "description": "ManagedFields maps workflow-id and version to the set of fields\nthat are managed by that workflow. This is mostly for internal\nhousekeeping, and users typically shouldn't need to set or\nunderstand this field. A workflow can be the user's name, a\ncontroller's name, or the name of a specific apply path like\n\"ci-cd\". The set of fields is always in the version that the\nworkflow used when modifying the object.\n\nThis field is alpha and can be changed or removed without notice.\n\n+optional", - "type": "array", - "items": { - "$ref": "#/definitions/v1ManagedFieldsEntry" - } - }, - "name": { - "type": "string", - "title": "Name must be unique within a namespace. Is required when creating resources, although\nsome resources may allow a client to request the generation of an appropriate name\nautomatically. Name is primarily intended for creation idempotence and configuration\ndefinition.\nCannot be updated.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#names\n+optional" - }, - "namespace": { - "description": "Namespace defines the space within each name must be unique. An empty namespace is\nequivalent to the \"default\" namespace, but \"default\" is the canonical representation.\nNot all objects are required to be scoped to a namespace - the value of this field for\nthose objects will be empty.\n\nMust be a DNS_LABEL.\nCannot be updated.\nMore info: http://kubernetes.io/docs/user-guide/namespaces\n+optional", - "type": "string" - }, - "ownerReferences": { - "type": "array", - "title": "List of objects depended by this object. If ALL objects in the list have\nbeen deleted, this object will be garbage collected. If this object is managed by a controller,\nthen an entry in this list will point to this controller, with the controller field set to true.\nThere cannot be more than one managing controller.\n+optional\n+patchMergeKey=uid\n+patchStrategy=merge", - "items": { - "$ref": "#/definitions/v1OwnerReference" - } - }, - "resourceVersion": { - "description": "An opaque value that represents the internal version of this object that can\nbe used by clients to determine when objects have changed. May be used for optimistic\nconcurrency, change detection, and the watch operation on a resource or set of resources.\nClients must treat these values as opaque and passed unmodified back to the server.\nThey may only be valid for a particular resource or set of resources.\n\nPopulated by the system.\nRead-only.\nValue must be treated as opaque by clients and .\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency\n+optional", - "type": "string" - }, - "selfLink": { - "type": "string", - "title": "SelfLink is a URL representing this object.\nPopulated by the system.\nRead-only.\n+optional" - }, - "uid": { - "description": "UID is the unique in time and space value for this object. It is typically generated by\nthe server on successful creation of a resource and is not allowed to change on PUT\noperations.\n\nPopulated by the system.\nRead-only.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#uids\n+optional", - "type": "string" - } - } - }, - "v1ObjectReference": { - "type": "object", - "title": "ObjectReference contains enough information to let you inspect or modify the referred object.\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - "properties": { - "apiVersion": { - "type": "string", - "title": "API version of the referent.\n+optional" - }, - "fieldPath": { - "type": "string", - "title": "If referring to a piece of an object instead of an entire object, this string\nshould contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].\nFor example, if the object reference is to a container within a pod, this would take on a value like:\n\"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered\nthe event) or if no container name is specified \"spec.containers[2]\" (container with\nindex 2 in this pod). This syntax is chosen only to have some well-defined way of\nreferencing a part of an object.\nTODO: this design is not final and this field is subject to change in the future.\n+optional" - }, - "kind": { - "type": "string", - "title": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds\n+optional" - }, - "name": { - "type": "string", - "title": "Name of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\n+optional" - }, - "namespace": { - "type": "string", - "title": "Namespace of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/\n+optional" - }, - "resourceVersion": { - "type": "string", - "title": "Specific resourceVersion to which this reference is made, if any.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency\n+optional" - }, - "uid": { - "type": "string", - "title": "UID of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids\n+optional" - } - } - }, - "v1OwnerReference": { - "description": "OwnerReference contains enough information to let you identify an owning\nobject. An owning object must be in the same namespace as the dependent, or\nbe cluster-scoped, so there is no namespace field.", - "type": "object", - "properties": { - "apiVersion": { - "description": "API version of the referent.", - "type": "string" - }, - "blockOwnerDeletion": { - "type": "boolean", - "format": "boolean", - "title": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then\nthe owner cannot be deleted from the key-value store until this\nreference is removed.\nDefaults to false.\nTo set this field, a user needs \"delete\" permission of the owner,\notherwise 422 (Unprocessable Entity) will be returned.\n+optional" - }, - "controller": { - "type": "boolean", - "format": "boolean", - "title": "If true, this reference points to the managing controller.\n+optional" - }, - "kind": { - "type": "string", - "title": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" - }, - "name": { - "type": "string", - "title": "Name of the referent.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#names" - }, - "uid": { - "type": "string", - "title": "UID of the referent.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#uids" - } - } - }, - "v1Status": { - "description": "Status is a return value for calls that don't return other objects.", - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "title": "Suggested HTTP return code for this status, 0 if not set.\n+optional" - }, - "details": { - "$ref": "#/definitions/v1StatusDetails" - }, - "message": { - "type": "string", - "title": "A human-readable description of the status of this operation.\n+optional" - }, - "metadata": { - "$ref": "#/definitions/v1ListMeta" - }, - "reason": { - "type": "string", - "title": "A machine-readable description of why this operation is in the\n\"Failure\" status. If this value is empty there\nis no information available. A Reason clarifies an HTTP status\ncode but does not override it.\n+optional" - }, - "status": { - "type": "string", - "title": "Status of the operation.\nOne of: \"Success\" or \"Failure\".\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status\n+optional" - } - } - }, - "v1StatusCause": { - "description": "StatusCause provides more information about an api.Status failure, including\ncases when multiple errors are encountered.", - "type": "object", - "properties": { - "field": { - "description": "The field of the resource that has caused this error, as named by its JSON\nserialization. May include dot and postfix notation for nested attributes.\nArrays are zero-indexed. Fields may appear more than once in an array of\ncauses due to fields having multiple errors.\nOptional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"\n+optional", - "type": "string" - }, - "message": { - "type": "string", - "title": "A human-readable description of the cause of the error. This field may be\npresented as-is to a reader.\n+optional" - }, - "reason": { - "type": "string", - "title": "A machine-readable description of the cause of the error. If this value is\nempty there is no information available.\n+optional" - } - } - }, - "v1StatusDetails": { - "description": "StatusDetails is a set of additional properties that MAY be set by the\nserver to provide additional information about a response. The Reason\nfield of a Status object defines what attributes will be set. Clients\nmust ignore fields that do not match the defined type of each attribute,\nand should assume that any attribute may be empty, invalid, or under\ndefined.", - "type": "object", - "properties": { - "causes": { - "type": "array", - "title": "The Causes array includes more details associated with the StatusReason\nfailure. Not all StatusReasons may provide detailed causes.\n+optional", - "items": { - "$ref": "#/definitions/v1StatusCause" - } - }, - "group": { - "type": "string", - "title": "The group attribute of the resource associated with the status StatusReason.\n+optional" - }, - "kind": { - "type": "string", - "title": "The kind attribute of the resource associated with the status StatusReason.\nOn some operations may differ from the requested resource Kind.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds\n+optional" - }, - "name": { - "type": "string", - "title": "The name attribute of the resource associated with the status StatusReason\n(when there is a single name which can be described).\n+optional" - }, - "retryAfterSeconds": { - "type": "integer", - "format": "int32", - "title": "If specified, the time in seconds before the operation should be retried. Some errors may indicate\nthe client must take an alternate action - for those errors this field may indicate how long to wait\nbefore taking the alternate action.\n+optional" - }, - "uid": { - "type": "string", - "title": "UID of the resource.\n(when there is a single resource which can be described).\nMore info: http://kubernetes.io/docs/user-guide/identifiers#uids\n+optional" - } - } - }, - "v1Time": { - "description": "Time is a wrapper around time.Time which supports correct\nmarshaling to YAML and JSON. Wrappers are provided for many\nof the factory methods that the time package offers.\n\n+protobuf.options.marshal=false\n+protobuf.as=Timestamp\n+protobuf.options.(gogoproto.goproto_stringer)=false", - "type": "object", - "properties": { - "nanos": { - "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive. This field may be limited in precision depending on context.", - "type": "integer", - "format": "int32" - }, - "seconds": { - "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.", - "type": "string", - "format": "int64" - } - } - }, - "v1alpha1AWSAuthConfig": { - "type": "object", - "title": "AWSAuthConfig is an AWS IAM authentication configuration", - "properties": { - "clusterName": { - "type": "string", - "title": "ClusterName contains AWS cluster name" - }, - "roleARN": { - "description": "RoleARN contains optional role ARN. If set then AWS IAM Authenticator assume a role to perform cluster operations instead of the default AWS credential provider chain.", - "type": "string" - } - } - }, - "v1alpha1AppProject": { - "type": "object", - "title": "AppProject provides a logical grouping of applications, providing controls for:\n* where the apps may deploy to (cluster whitelist)\n* what may be deployed (repository whitelist, resource whitelist/blacklist)\n* who can access these applications (roles, OIDC group claims bindings)\n* and what they can do (RBAC policies)\n* automation access to these roles (JWT tokens)\n+genclient\n+genclient:noStatus\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\n+kubebuilder:resource:path=appprojects,shortName=appproj;appprojs", - "properties": { - "metadata": { - "$ref": "#/definitions/v1ObjectMeta" - }, - "spec": { - "$ref": "#/definitions/v1alpha1AppProjectSpec" - } - } - }, - "v1alpha1AppProjectList": { - "type": "object", - "title": "AppProjectList is list of AppProject resources\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1AppProject" - } - }, - "metadata": { - "$ref": "#/definitions/v1ListMeta" - } - } - }, - "v1alpha1AppProjectSpec": { - "type": "object", - "title": "AppProjectSpec is the specification of an AppProject", - "properties": { - "clusterResourceWhitelist": { - "type": "array", - "title": "ClusterResourceWhitelist contains list of whitelisted cluster level resources", - "items": { - "$ref": "#/definitions/v1GroupKind" - } - }, - "description": { - "type": "string", - "title": "Description contains optional project description" - }, - "destinations": { - "type": "array", - "title": "Destinations contains list of destinations available for deployment", - "items": { - "$ref": "#/definitions/v1alpha1ApplicationDestination" - } - }, - "namespaceResourceBlacklist": { - "type": "array", - "title": "NamespaceResourceBlacklist contains list of blacklisted namespace level resources", - "items": { - "$ref": "#/definitions/v1GroupKind" - } - }, - "roles": { - "type": "array", - "title": "Roles are user defined RBAC roles associated with this project", - "items": { - "$ref": "#/definitions/v1alpha1ProjectRole" - } - }, - "sourceRepos": { - "type": "array", - "title": "SourceRepos contains list of git repository URLs which can be used for deployment", - "items": { - "type": "string" - } - } - } - }, - "v1alpha1Application": { - "type": "object", - "title": "Application is a definition of Application resource.\n+genclient\n+genclient:noStatus\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\n+kubebuilder:resource:path=applications,shortName=app;apps", - "properties": { - "metadata": { - "$ref": "#/definitions/v1ObjectMeta" - }, - "operation": { - "$ref": "#/definitions/v1alpha1Operation" - }, - "spec": { - "$ref": "#/definitions/v1alpha1ApplicationSpec" - }, - "status": { - "$ref": "#/definitions/v1alpha1ApplicationStatus" - } - } - }, - "v1alpha1ApplicationCondition": { - "type": "object", - "title": "ApplicationCondition contains details about current application condition", - "properties": { - "message": { - "type": "string", - "title": "Message contains human-readable message indicating details about condition" - }, - "type": { - "type": "string", - "title": "Type is an application condition type" - } - } - }, - "v1alpha1ApplicationDestination": { - "type": "object", - "title": "ApplicationDestination contains deployment destination information", - "properties": { - "namespace": { - "type": "string", - "title": "Namespace overrides the environment namespace value in the ksonnet app.yaml" - }, - "server": { - "type": "string", - "title": "Server overrides the environment server value in the ksonnet app.yaml" - } - } - }, - "v1alpha1ApplicationList": { - "type": "object", - "title": "ApplicationList is list of Application resources\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1Application" - } - }, - "metadata": { - "$ref": "#/definitions/v1ListMeta" - } - } - }, - "v1alpha1ApplicationSource": { - "description": "ApplicationSource contains information about github repository, path within repository and target application environment.", - "type": "object", - "properties": { - "directory": { - "$ref": "#/definitions/v1alpha1ApplicationSourceDirectory" - }, - "helm": { - "$ref": "#/definitions/v1alpha1ApplicationSourceHelm" - }, - "ksonnet": { - "$ref": "#/definitions/v1alpha1ApplicationSourceKsonnet" - }, - "kustomize": { - "$ref": "#/definitions/v1alpha1ApplicationSourceKustomize" - }, - "path": { - "type": "string", - "title": "Path is a directory path within the repository containing a" - }, - "plugin": { - "$ref": "#/definitions/v1alpha1ApplicationSourcePlugin" - }, - "repoURL": { - "type": "string", - "title": "RepoURL is the git repository URL of the application manifests" - }, - "targetRevision": { - "type": "string", - "title": "TargetRevision defines the commit, tag, or branch in which to sync the application to.\nIf omitted, will sync to HEAD" - } - } - }, - "v1alpha1ApplicationSourceDirectory": { - "type": "object", - "properties": { - "jsonnet": { - "$ref": "#/definitions/v1alpha1ApplicationSourceJsonnet" - }, - "recurse": { - "type": "boolean", - "format": "boolean" - } - } - }, - "v1alpha1ApplicationSourceHelm": { - "type": "object", - "title": "ApplicationSourceHelm holds helm specific options", - "properties": { - "parameters": { - "type": "array", - "title": "Parameters are parameters to the helm template", - "items": { - "$ref": "#/definitions/v1alpha1HelmParameter" - } - }, - "releaseName": { - "type": "string", - "title": "The Helm release name. If omitted it will use the application name" - }, - "valueFiles": { - "type": "array", - "title": "ValuesFiles is a list of Helm value files to use when generating a template", - "items": { - "type": "string" - } - } - } - }, - "v1alpha1ApplicationSourceJsonnet": { - "type": "object", - "title": "ApplicationSourceJsonnet holds jsonnet specific options", - "properties": { - "extVars": { - "type": "array", - "title": "ExtVars is a list of Jsonnet External Variables", - "items": { - "$ref": "#/definitions/v1alpha1JsonnetVar" - } - }, - "tlas": { - "type": "array", - "title": "TLAS is a list of Jsonnet Top-level Arguments", - "items": { - "$ref": "#/definitions/v1alpha1JsonnetVar" - } - } - } - }, - "v1alpha1ApplicationSourceKsonnet": { - "type": "object", - "title": "ApplicationSourceKsonnet holds ksonnet specific options", - "properties": { - "environment": { - "type": "string", - "title": "Environment is a ksonnet application environment name" - }, - "parameters": { - "type": "array", - "title": "Parameters are a list of ksonnet component parameter override values", - "items": { - "$ref": "#/definitions/v1alpha1KsonnetParameter" - } - } - } - }, - "v1alpha1ApplicationSourceKustomize": { - "type": "object", - "title": "ApplicationSourceKustomize holds kustomize specific options", - "properties": { - "commonLabels": { - "type": "object", - "title": "CommonLabels adds additional kustomize commonLabels", - "additionalProperties": { - "type": "string" - } - }, - "images": { - "type": "array", - "title": "Images are kustomize image overrides", - "items": { - "type": "string" - } - }, - "namePrefix": { - "type": "string", - "title": "NamePrefix is a prefix appended to resources for kustomize apps" - } - } - }, - "v1alpha1ApplicationSourcePlugin": { - "type": "object", - "title": "ApplicationSourcePlugin holds config management plugin specific options", - "properties": { - "env": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1EnvEntry" - } - }, - "name": { - "type": "string" - } - } - }, - "v1alpha1ApplicationSpec": { - "description": "ApplicationSpec represents desired application state. Contains link to repository with application definition and additional parameters link definition revision.", - "type": "object", - "properties": { - "destination": { - "$ref": "#/definitions/v1alpha1ApplicationDestination" - }, - "ignoreDifferences": { - "type": "array", - "title": "IgnoreDifferences controls resources fields which should be ignored during comparison", - "items": { - "$ref": "#/definitions/v1alpha1ResourceIgnoreDifferences" - } - }, - "info": { - "type": "array", - "title": "Infos contains a list of useful information (URLs, email addresses, and plain text) that relates to the application", - "items": { - "$ref": "#/definitions/v1alpha1Info" - } - }, - "project": { - "description": "Project is a application project name. Empty name means that application belongs to 'default' project.", - "type": "string" - }, - "source": { - "$ref": "#/definitions/v1alpha1ApplicationSource" - }, - "syncPolicy": { - "$ref": "#/definitions/v1alpha1SyncPolicy" - } - } - }, - "v1alpha1ApplicationStatus": { - "type": "object", - "title": "ApplicationStatus contains information about application sync, health status", - "properties": { - "conditions": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ApplicationCondition" - } - }, - "health": { - "$ref": "#/definitions/v1alpha1HealthStatus" - }, - "history": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1RevisionHistory" - } - }, - "observedAt": { - "$ref": "#/definitions/v1Time" - }, - "operationState": { - "$ref": "#/definitions/v1alpha1OperationState" - }, - "reconciledAt": { - "$ref": "#/definitions/v1Time" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ResourceStatus" - } - }, - "sourceType": { - "type": "string" - }, - "summary": { - "$ref": "#/definitions/v1alpha1ApplicationSummary" - }, - "sync": { - "$ref": "#/definitions/v1alpha1SyncStatus" - } - } - }, - "v1alpha1ApplicationSummary": { - "type": "object", - "properties": { - "externalURLs": { - "description": "ExternalURLs holds all external URLs of application child resources.", - "type": "array", - "items": { - "type": "string" - } - }, - "images": { - "description": "Images holds all images of application child resources.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "v1alpha1ApplicationTree": { - "type": "object", - "title": "ApplicationTree holds nodes which belongs to the application", - "properties": { - "nodes": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ResourceNode" - } - } - } - }, - "v1alpha1ApplicationWatchEvent": { - "description": "ApplicationWatchEvent contains information about application change.", - "type": "object", - "properties": { - "application": { - "$ref": "#/definitions/v1alpha1Application" - }, - "type": { - "type": "string" - } - } - }, - "v1alpha1Cluster": { - "type": "object", - "title": "Cluster is the definition of a cluster resource", - "properties": { - "config": { - "$ref": "#/definitions/v1alpha1ClusterConfig" - }, - "connectionState": { - "$ref": "#/definitions/v1alpha1ConnectionState" - }, - "name": { - "type": "string", - "title": "Name of the cluster. If omitted, will use the server address" - }, - "server": { - "type": "string", - "title": "Server is the API server URL of the Kubernetes cluster" - } - } - }, - "v1alpha1ClusterConfig": { - "description": "ClusterConfig is the configuration attributes. This structure is subset of the go-client\nrest.Config with annotations added for marshalling.", - "type": "object", - "properties": { - "awsAuthConfig": { - "$ref": "#/definitions/v1alpha1AWSAuthConfig" - }, - "bearerToken": { - "description": "Server requires Bearer authentication. This client will not attempt to use\nrefresh tokens for an OAuth2 flow.\nTODO: demonstrate an OAuth2 compatible client.", - "type": "string" - }, - "password": { - "type": "string" - }, - "tlsClientConfig": { - "$ref": "#/definitions/v1alpha1TLSClientConfig" - }, - "username": { - "type": "string", - "title": "Server requires Basic authentication" - } - } - }, - "v1alpha1ClusterList": { - "description": "ClusterList is a collection of Clusters.", - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1Cluster" - } - }, - "metadata": { - "$ref": "#/definitions/v1ListMeta" - } - } - }, - "v1alpha1ComparedTo": { - "type": "object", - "title": "ComparedTo contains application source and target which was used for resources comparison", - "properties": { - "destination": { - "$ref": "#/definitions/v1alpha1ApplicationDestination" - }, - "source": { - "$ref": "#/definitions/v1alpha1ApplicationSource" - } - } - }, - "v1alpha1ConnectionState": { - "type": "object", - "title": "ConnectionState contains information about remote resource connection state", - "properties": { - "attemptedAt": { - "$ref": "#/definitions/v1Time" - }, - "message": { - "type": "string" - }, - "status": { - "type": "string" - } - } - }, - "v1alpha1EnvEntry": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "the name, usually uppercase" - }, - "value": { - "type": "string", - "title": "the value" - } - } - }, - "v1alpha1HealthStatus": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "status": { - "type": "string" - } - } - }, - "v1alpha1HelmParameter": { - "type": "object", - "title": "HelmParameter is a parameter to a helm template", - "properties": { - "forceString": { - "type": "boolean", - "format": "boolean", - "title": "ForceString determines whether to tell Helm to interpret booleans and numbers as strings" - }, - "name": { - "type": "string", - "title": "Name is the name of the helm parameter" - }, - "value": { - "type": "string", - "title": "Value is the value for the helm parameter" - } - } - }, - "v1alpha1Info": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "v1alpha1InfoItem": { - "type": "object", - "title": "InfoItem contains human readable information about object", - "properties": { - "name": { - "description": "Name is a human readable title for this piece of information.", - "type": "string" - }, - "value": { - "description": "Value is human readable content.", - "type": "string" - } - } - }, - "v1alpha1JWTToken": { - "type": "object", - "title": "JWTToken holds the issuedAt and expiresAt values of a token", - "properties": { - "exp": { - "type": "string", - "format": "int64" - }, - "iat": { - "type": "string", - "format": "int64" - } - } - }, - "v1alpha1JsonnetVar": { - "type": "object", - "title": "JsonnetVar is a jsonnet variable", - "properties": { - "code": { - "type": "boolean", - "format": "boolean" - }, - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "v1alpha1KsonnetParameter": { - "type": "object", - "title": "KsonnetParameter is a ksonnet component parameter", - "properties": { - "component": { - "type": "string" - }, - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "v1alpha1KustomizeOptions": { - "type": "object", - "title": "KustomizeOptions are options for kustomize to use when building manifests", - "properties": { - "buildOptions": { - "type": "string", - "title": "BuildOptions is a string of build parameters to use when calling `kustomize build`" - } - } - }, - "v1alpha1Operation": { - "description": "Operation contains requested operation parameters.", - "type": "object", - "properties": { - "sync": { - "$ref": "#/definitions/v1alpha1SyncOperation" - } - } - }, - "v1alpha1OperationState": { - "description": "OperationState contains information about state of currently performing operation on application.", - "type": "object", - "properties": { - "finishedAt": { - "$ref": "#/definitions/v1Time" - }, - "message": { - "description": "Message hold any pertinent messages when attempting to perform operation (typically errors).", - "type": "string" - }, - "operation": { - "$ref": "#/definitions/v1alpha1Operation" - }, - "phase": { - "type": "string", - "title": "Phase is the current phase of the operation" - }, - "startedAt": { - "$ref": "#/definitions/v1Time" - }, - "syncResult": { - "$ref": "#/definitions/v1alpha1SyncOperationResult" - } - } - }, - "v1alpha1ProjectRole": { - "type": "object", - "title": "ProjectRole represents a role that has access to a project", - "properties": { - "description": { - "type": "string", - "title": "Description is a description of the role" - }, - "groups": { - "type": "array", - "title": "Groups are a list of OIDC group claims bound to this role", - "items": { - "type": "string" - } - }, - "jwtTokens": { - "type": "array", - "title": "JWTTokens are a list of generated JWT tokens bound to this role", - "items": { - "$ref": "#/definitions/v1alpha1JWTToken" - } - }, - "name": { - "type": "string", - "title": "Name is a name for this role" - }, - "policies": { - "type": "array", - "title": "Policies Stores a list of casbin formated strings that define access policies for the role in the project", - "items": { - "type": "string" - } - } - } - }, - "v1alpha1Repository": { - "type": "object", - "title": "Repository is a Git repository holding application configurations", - "properties": { - "connectionState": { - "$ref": "#/definitions/v1alpha1ConnectionState" - }, - "enableLfs": { - "type": "boolean", - "format": "boolean", - "title": "Whether git-lfs support should be enabled for this repo" - }, - "insecure": { - "type": "boolean", - "format": "boolean", - "title": "Whether the repo is insecure" - }, - "insecureIgnoreHostKey": { - "type": "boolean", - "format": "boolean", - "title": "InsecureIgnoreHostKey should not be used anymore, Insecure is favoured" - }, - "password": { - "type": "string", - "title": "Password for authenticating at the repo server" - }, - "repo": { - "type": "string", - "title": "URL of the repo" - }, - "sshPrivateKey": { - "type": "string", - "title": "SSH private key data for authenticating at the repo server" - }, - "tlsClientCertData": { - "type": "string", - "title": "TLS client cert data for authenticating at the repo server" - }, - "tlsClientCertKey": { - "type": "string", - "title": "TLS client cert key for authenticating at the repo server" - }, - "username": { - "type": "string", - "title": "Username for authenticating at the repo server" - } - } - }, - "v1alpha1RepositoryCertificate": { - "type": "object", - "title": "A RepositoryCertificate is either SSH known hosts entry or TLS certificate", - "properties": { - "certData": { - "type": "string", - "format": "byte", - "title": "Actual certificate data, protocol dependent" - }, - "certInfo": { - "type": "string", - "title": "Additional certificate info (e.g. SSH fingerprint, X509 CommonName)" - }, - "certSubType": { - "type": "string", - "title": "The sub type of the cert, i.e. \"ssh-rsa\"" - }, - "certType": { - "type": "string", - "title": "Type of certificate - currently \"https\" or \"ssh\"" - }, - "serverName": { - "type": "string", - "title": "Name of the server the certificate is intended for" - } - } - }, - "v1alpha1RepositoryCertificateList": { - "type": "object", - "title": "RepositoryCertificateList is a collection of RepositoryCertificates", - "properties": { - "items": { - "type": "array", - "title": "List of certificates to be processed", - "items": { - "$ref": "#/definitions/v1alpha1RepositoryCertificate" - } - }, - "metadata": { - "$ref": "#/definitions/v1ListMeta" - } - } - }, - "v1alpha1RepositoryList": { - "description": "RepositoryList is a collection of Repositories.", - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1Repository" - } - }, - "metadata": { - "$ref": "#/definitions/v1ListMeta" - } - } - }, - "v1alpha1ResourceAction": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "params": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ResourceActionParam" - } - } - } - }, - "v1alpha1ResourceActionParam": { - "type": "object", - "properties": { - "default": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "value": { - "type": "string" - } - } - }, - "v1alpha1ResourceDiff": { - "type": "object", - "title": "ResourceDiff holds the diff of a live and target resource object", - "properties": { - "diff": { - "type": "string" - }, - "group": { - "type": "string" - }, - "hook": { - "type": "boolean", - "format": "boolean" - }, - "kind": { - "type": "string" - }, - "liveState": { - "type": "string" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "targetState": { - "type": "string" - } - } - }, - "v1alpha1ResourceIgnoreDifferences": { - "description": "ResourceIgnoreDifferences contains resource filter and list of json paths which should be ignored during comparison with live state.", - "type": "object", - "properties": { - "group": { - "type": "string" - }, - "jsonPointers": { - "type": "array", - "items": { - "type": "string" - } - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - } - } - }, - "v1alpha1ResourceNetworkingInfo": { - "type": "object", - "title": "ResourceNetworkingInfo holds networking resource related information", - "properties": { - "externalURLs": { - "description": "ExternalURLs holds list of URLs which should be available externally. List is populated for ingress resources using rules hostnames.", - "type": "array", - "items": { - "type": "string" - } - }, - "ingress": { - "type": "array", - "items": { - "$ref": "#/definitions/v1LoadBalancerIngress" - } - }, - "labels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "targetLabels": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "targetRefs": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ResourceRef" - } - } - } - }, - "v1alpha1ResourceNode": { - "type": "object", - "title": "ResourceNode contains information about live resource and its children", - "properties": { - "health": { - "$ref": "#/definitions/v1alpha1HealthStatus" - }, - "images": { - "type": "array", - "items": { - "type": "string" - } - }, - "info": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1InfoItem" - } - }, - "networkingInfo": { - "$ref": "#/definitions/v1alpha1ResourceNetworkingInfo" - }, - "parentRefs": { - "type": "array", - "items": { - "$ref": "#/definitions/v1alpha1ResourceRef" - } - }, - "resourceRef": { - "$ref": "#/definitions/v1alpha1ResourceRef" - }, - "resourceVersion": { - "type": "string" - } - } - }, - "v1alpha1ResourceOverride": { - "type": "object", - "title": "ResourceOverride holds configuration to customize resource diffing and health assessment", - "properties": { - "actions": { - "type": "string" - }, - "healthLua": { - "type": "string" - }, - "ignoreDifferences": { - "type": "string" - } - } - }, - "v1alpha1ResourceRef": { - "type": "object", - "title": "ResourceRef includes fields which unique identify resource", - "properties": { - "group": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "uid": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "v1alpha1ResourceResult": { - "type": "object", - "title": "ResourceResult holds the operation result details of a specific resource", - "properties": { - "group": { - "type": "string" - }, - "hookPhase": { - "type": "string", - "title": "the state of any operation associated with this resource OR hook\nnote: can contain values for non-hook resources" - }, - "hookType": { - "type": "string", - "title": "the type of the hook, empty for non-hook resources" - }, - "kind": { - "type": "string" - }, - "message": { - "type": "string", - "title": "message for the last sync OR operation" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "status": { - "type": "string", - "title": "the final result of the sync, this is be empty if the resources is yet to be applied/pruned and is always zero-value for hooks" - }, - "syncPhase": { - "type": "string", - "title": "indicates the particular phase of the sync that this is for" - }, - "version": { - "type": "string" - } - } - }, - "v1alpha1ResourceStatus": { - "type": "object", - "title": "ResourceStatus holds the current sync and health status of a resource", - "properties": { - "group": { - "type": "string" - }, - "health": { - "$ref": "#/definitions/v1alpha1HealthStatus" - }, - "hook": { - "type": "boolean", - "format": "boolean" - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "requiresPruning": { - "type": "boolean", - "format": "boolean" - }, - "status": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "v1alpha1RevisionHistory": { - "type": "object", - "title": "RevisionHistory contains information relevant to an application deployment", - "properties": { - "deployedAt": { - "$ref": "#/definitions/v1Time" - }, - "id": { - "type": "string", - "format": "int64" - }, - "revision": { - "type": "string" - }, - "source": { - "$ref": "#/definitions/v1alpha1ApplicationSource" - } - } - }, - "v1alpha1RevisionMetadata": { - "type": "object", - "title": "data about a specific revision within a repo", - "properties": { - "author": { - "type": "string", - "title": "who authored this revision,\ntypically their name and email, e.g. \"John Doe \",\nbut might not match this example" - }, - "date": { - "$ref": "#/definitions/v1Time" - }, - "message": { - "type": "string", - "title": "the message associated with the revision,\nprobably the commit message,\nthis is truncated to the first newline or 64 characters (which ever comes first)" - }, - "tags": { - "type": "array", - "title": "tags on the revision,\nnote - tags can move from one revision to another", - "items": { - "type": "string" - } - } - } - }, - "v1alpha1SyncOperation": { - "description": "SyncOperation contains sync operation details.", - "type": "object", - "properties": { - "dryRun": { - "type": "boolean", - "format": "boolean", - "title": "DryRun will perform a `kubectl apply --dry-run` without actually performing the sync" - }, - "manifests": { - "type": "array", - "title": "Manifests is an optional field that overrides sync source with a local directory for development", - "items": { - "type": "string" - } - }, - "prune": { - "type": "boolean", - "format": "boolean", - "title": "Prune deletes resources that are no longer tracked in git" - }, - "resources": { - "type": "array", - "title": "Resources describes which resources to sync", - "items": { - "$ref": "#/definitions/v1alpha1SyncOperationResource" - } - }, - "revision": { - "description": "Revision is the git revision in which to sync the application to.\nIf omitted, will use the revision specified in app spec.", - "type": "string" - }, - "source": { - "$ref": "#/definitions/v1alpha1ApplicationSource" - }, - "syncStrategy": { - "$ref": "#/definitions/v1alpha1SyncStrategy" - } - } - }, - "v1alpha1SyncOperationResource": { - "description": "SyncOperationResource contains resources to sync.", - "type": "object", - "properties": { - "group": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "v1alpha1SyncOperationResult": { - "type": "object", - "title": "SyncOperationResult represent result of sync operation", - "properties": { - "resources": { - "type": "array", - "title": "Resources holds the sync result of each individual resource", - "items": { - "$ref": "#/definitions/v1alpha1ResourceResult" - } - }, - "revision": { - "type": "string", - "title": "Revision holds the git commit SHA of the sync" - }, - "source": { - "$ref": "#/definitions/v1alpha1ApplicationSource" - } - } - }, - "v1alpha1SyncPolicy": { - "type": "object", - "title": "SyncPolicy controls when a sync will be performed in response to updates in git", - "properties": { - "automated": { - "$ref": "#/definitions/v1alpha1SyncPolicyAutomated" - } - } - }, - "v1alpha1SyncPolicyAutomated": { - "type": "object", - "title": "SyncPolicyAutomated controls the behavior of an automated sync", - "properties": { - "prune": { - "type": "boolean", - "format": "boolean", - "title": "Prune will prune resources automatically as part of automated sync (default: false)" - }, - "selfHeal": { - "type": "boolean", - "format": "boolean", - "title": "SelfHeal enables auto-syncing if (default: false)" - } - } - }, - "v1alpha1SyncStatus": { - "description": "SyncStatus is a comparison result of application spec and deployed application.", - "type": "object", - "properties": { - "comparedTo": { - "$ref": "#/definitions/v1alpha1ComparedTo" - }, - "revision": { - "type": "string" - }, - "status": { - "type": "string" - } - } - }, - "v1alpha1SyncStrategy": { - "type": "object", - "title": "SyncStrategy controls the manner in which a sync is performed", - "properties": { - "apply": { - "$ref": "#/definitions/v1alpha1SyncStrategyApply" - }, - "hook": { - "$ref": "#/definitions/v1alpha1SyncStrategyHook" - } - } - }, - "v1alpha1SyncStrategyApply": { - "type": "object", - "title": "SyncStrategyApply uses `kubectl apply` to perform the apply", - "properties": { - "force": { - "description": "Force indicates whether or not to supply the --force flag to `kubectl apply`.\nThe --force flag deletes and re-create the resource, when PATCH encounters conflict and has\nretried for 5 times.", - "type": "boolean", - "format": "boolean" - } - } - }, - "v1alpha1SyncStrategyHook": { - "description": "SyncStrategyHook will perform a sync using hooks annotations.\nIf no hook annotation is specified falls back to `kubectl apply`.", - "type": "object", - "properties": { - "syncStrategyApply": { - "$ref": "#/definitions/v1alpha1SyncStrategyApply" - } - } - }, - "v1alpha1TLSClientConfig": { - "type": "object", - "title": "TLSClientConfig contains settings to enable transport layer security", - "properties": { - "caData": { - "type": "string", - "format": "byte", - "title": "CAData holds PEM-encoded bytes (typically read from a root certificates bundle).\nCAData takes precedence over CAFile" - }, - "certData": { - "type": "string", - "format": "byte", - "title": "CertData holds PEM-encoded bytes (typically read from a client certificate file).\nCertData takes precedence over CertFile" - }, - "insecure": { - "description": "Server should be accessed without verifying the TLS certificate. For testing only.", - "type": "boolean", - "format": "boolean" - }, - "keyData": { - "type": "string", - "format": "byte", - "title": "KeyData holds PEM-encoded bytes (typically read from a client certificate key file).\nKeyData takes precedence over KeyFile" - }, - "serverName": { - "description": "ServerName is passed to the server for SNI and is used in the client to check server\ncertificates against. If ServerName is empty, the hostname used to contact the\nserver is used.", - "type": "string" - } - } - }, - "versionVersionMessage": { - "type": "object", - "title": "VersionMessage represents version of the Argo CD API server", - "properties": { - "BuildDate": { - "type": "string" - }, - "Compiler": { - "type": "string" - }, - "GitCommit": { - "type": "string" - }, - "GitTag": { - "type": "string" - }, - "GitTreeState": { - "type": "string" - }, - "GoVersion": { - "type": "string" - }, - "KsonnetVersion": { - "type": "string" - }, - "Platform": { - "type": "string" - }, - "Version": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go index 7a8321b187..9288d1bacb 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go @@ -57,8 +57,7 @@ func (impl *BlobStorageServiceImpl) Get(request *BlobStorageRequest) (bool, int6 file, err := os.Create("/" + request.DestinationKey) defer file.Close() if err != nil { - log.Println(err) - return false, 0, err + log.Fatal(err) } switch request.StorageType { case BLOB_STORAGE_S3: diff --git a/vendor/github.com/devtron-labs/common-lib/constants/constants.go b/vendor/github.com/devtron-labs/common-lib/constants/constants.go index 6ea4e161dc..a7e41944da 100644 --- a/vendor/github.com/devtron-labs/common-lib/constants/constants.go +++ b/vendor/github.com/devtron-labs/common-lib/constants/constants.go @@ -1,25 +1,3 @@ package constants const PanicLogIdentifier = "DEVTRON_PANIC_RECOVER" - -// metrics name constants - -const ( - NATS_PUBLISH_COUNT = "Nats_Publish_Count" - NATS_CONSUMPTION_COUNT = "Nats_Consumption_Count" - NATS_CONSUMING_COUNT = "Nats_Consuming_Count" - NATS_EVENT_CONSUMPTION_TIME = "Nats_Event_Consumption_Time" - NATS_EVENT_PUBLISH_TIME = "Nats_Event_Publish_Time" - NATS_EVENT_DELIVERY_COUNT = "Nats_Event_Delivery_Count" - PANIC_RECOVERY_COUNT = "Panic_Recovery_Count" -) - -// metrcis lables constant -const ( - PANIC_TYPE = "panicType" - HOST = "host" - METHOD = "method" - PATH = "path" - TOPIC = "topic" - STATUS = "status" -) diff --git a/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go b/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go index 804fbcb5b9..6834f61727 100644 --- a/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go +++ b/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go @@ -3,7 +3,6 @@ package middlewares import ( "encoding/json" "github.com/devtron-labs/common-lib/constants" - "github.com/devtron-labs/common-lib/pubsub-lib/metrics" "log" "net/http" "runtime/debug" @@ -15,7 +14,6 @@ func Recovery(next http.Handler) http.Handler { defer func() { err := recover() if err != nil { - metrics.IncPanicRecoveryCount("handler", r.Host, r.Method, r.RequestURI) log.Print(constants.PanicLogIdentifier, "recovered from panic", "err", err, "stack", string(debug.Stack())) jsonBody, _ := json.Marshal(map[string]string{ "error": "internal server error", diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go index 93af19e669..93a1660253 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go @@ -101,9 +101,9 @@ const ( CD_PIPELINE_DELETE_EVENT_TOPIC string = "CD-PIPELINE-DELETE-EVENT" CD_PIPELINE_DELETE_EVENT_GROUP string = "CD-PIPELINE-DELETE-EVENT-GROUP" CD_PIPELINE_DELETE_EVENT_DURABLE string = "CD-PIPELINE-DELETE-EVENT-DURABLE" - CHART_SCAN_TOPIC string = "CHART-SCAN-TOPIC" - CHART_SCAN_GROUP string = "CHART-SCAN-GROUP" - CHART_SCAN_DURABLE string = "CHART-SCAN-DURABLE" + NOTIFICATION_EVENT_TOPIC string = "NOTIFICATION_EVENT_TOPIC" + NOTIFICATION_EVENT_GROUP string = "NOTIFICATION_EVENT_GROUP" + NOTIFICATION_EVENT_DURABLE string = "NOTIFICATION_EVENT_DURABLE" ) type NatsTopic struct { @@ -112,6 +112,7 @@ type NatsTopic struct { queueName string // needed for load balancing consumerName string } + type ConfigJson struct { // StreamConfigJson is a json string of map[string]NatsStreamConfig StreamConfigJson string `env:"STREAM_CONFIG_JSON"` @@ -150,7 +151,7 @@ var natsTopicMapping = map[string]NatsTopic{ CD_STAGE_SUCCESS_EVENT_TOPIC: {topicName: CD_STAGE_SUCCESS_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CD_STAGE_SUCCESS_EVENT_GROUP, consumerName: CD_STAGE_SUCCESS_EVENT_DURABLE}, CD_PIPELINE_DELETE_EVENT_TOPIC: {topicName: CD_PIPELINE_DELETE_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CD_PIPELINE_DELETE_EVENT_GROUP, consumerName: CD_PIPELINE_DELETE_EVENT_DURABLE}, - CHART_SCAN_TOPIC: {topicName: CHART_SCAN_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CHART_SCAN_GROUP, consumerName: CHART_SCAN_DURABLE}, + NOTIFICATION_EVENT_TOPIC: {topicName: NOTIFICATION_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: NOTIFICATION_EVENT_GROUP, consumerName: NOTIFICATION_EVENT_DURABLE}, } var NatsStreamWiseConfigMapping = map[string]NatsStreamConfig{ @@ -186,6 +187,7 @@ var NatsConsumerWiseConfigMapping = map[string]NatsConsumerConfig{ DEVTRON_TEST_CONSUMER: {}, CD_STAGE_SUCCESS_EVENT_DURABLE: {}, CD_PIPELINE_DELETE_EVENT_DURABLE: {}, + NOTIFICATION_EVENT_DURABLE: {}, } // getConsumerConfigMap will fetch the consumer wise config from the json string @@ -228,12 +230,11 @@ func getStreamConfigMap(jsonString string) map[string]NatsStreamConfig { return resMap } -func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() error { +func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { configJson := ConfigJson{} err := env.Parse(&configJson) if err != nil { - log.Println("error while parsing config from environment params", " err", err) - return err + log.Fatal("error while parsing config from environment params", " err", err) } // fetch the consumer configs that were given explicitly in the configJson.ConsumerConfigJson @@ -246,7 +247,6 @@ func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() error { err = env.Parse(&defaultConfig) if err != nil { log.Print("error while parsing config from environment params", "err", err) - return err } // default stream and consumer config values @@ -258,7 +258,6 @@ func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() error { // initialise all the stream wise config with default values or user defined values updateNatsStreamConfigMapping(defaultStreamConfigVal, streamConfigMap) - return nil } func updateNatsConsumerConfigMapping(defaultConsumerConfigVal NatsConsumerConfig, consumerConfigMap map[string]NatsConsumerConfig) { @@ -313,12 +312,11 @@ func AddStream(js nats.JetStreamContext, streamConfig *nats.StreamConfig, stream cfgToSet := getNewConfig(streamName, streamConfig) _, err = js.AddStream(cfgToSet) if err != nil { - log.Println("Error while creating stream. ", "stream name: ", streamName, "error: ", err) + log.Fatal("Error while creating stream. ", "stream name: ", streamName, "error: ", err) return err } } else if err != nil { - log.Println("Error while getting stream info. ", "stream name: ", streamName, "error: ", err) - return err + log.Fatal("Error while getting stream info. ", "stream name: ", streamName, "error: ", err) } else { config := streamInfo.Config streamConfig.Name = streamName @@ -336,7 +334,7 @@ func AddStream(js nats.JetStreamContext, streamConfig *nats.StreamConfig, stream func checkConfigChangeReqd(existingConfig *nats.StreamConfig, toUpdateConfig *nats.StreamConfig) bool { configChanged := false newStreamSubjects := GetStreamSubjects(toUpdateConfig.Name) - if ((toUpdateConfig.MaxAge != time.Duration(0)) && (toUpdateConfig.MaxAge != existingConfig.MaxAge)) || (len(newStreamSubjects) != len(existingConfig.Subjects)) { + if ((toUpdateConfig.MaxAge != time.Duration(0)) && (toUpdateConfig.MaxAge != existingConfig.MaxAge)) || (len(newStreamSubjects) != len(existingConfig.Subjects) || (toUpdateConfig.Replicas != existingConfig.Replicas)) { existingConfig.MaxAge = toUpdateConfig.MaxAge existingConfig.Subjects = newStreamSubjects configChanged = true diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go index a25eb3dbac..05021e28ca 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go @@ -47,6 +47,7 @@ type NatsClientConfig struct { NatsMsgBufferSize int `env:"NATS_MSG_BUFFER_SIZE" envDefault:"-1"` NatsMsgMaxAge int `env:"NATS_MSG_MAX_AGE" envDefault:"86400"` NatsMsgAckWaitInSecs int `env:"NATS_MSG_ACK_WAIT_IN_SECS" envDefault:"120"` + Replicas int `env:"REPLICAS" envDefault:"0"` } func (ncc NatsClientConfig) GetNatsMsgBufferSize() int { @@ -62,6 +63,7 @@ func (ncc NatsClientConfig) GetDefaultNatsConsumerConfig() NatsConsumerConfig { NatsMsgProcessingBatchSize: ncc.NatsMsgProcessingBatchSize, NatsMsgBufferSize: ncc.GetNatsMsgBufferSize(), AckWaitInSecs: ncc.NatsMsgAckWaitInSecs, + Replicas: ncc.Replicas, } } @@ -74,8 +76,10 @@ func (ncc NatsClientConfig) GetDefaultNatsStreamConfig() NatsStreamConfig { } type StreamConfig struct { - MaxAge time.Duration `json:"max_age"` + MaxAge time.Duration `json:"max_age"` + Replicas int `json:"num_replicas"` } + type NatsStreamConfig struct { StreamConfig StreamConfig `json:"streamConfig"` } @@ -88,6 +92,8 @@ type NatsConsumerConfig struct { NatsMsgBufferSize int `json:"natsMsgBufferSize"` // AckWaitInSecs is the time in seconds for which the message can be in unacknowledged state AckWaitInSecs int `json:"ackWaitInSecs"` + //it will show the instances created for the consumers on a particular subject(topic) + Replicas int `json:"replicas"` } func (consumerConf NatsConsumerConfig) GetNatsMsgBufferSize() int { diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go index e53d2aaef5..4d08a0b662 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go @@ -27,6 +27,7 @@ type LoggerFunc func(msg model.PubSubMsg) (logMsg string, keysAndValues []interf type PubSubClientService interface { Publish(topic string, msg string) error Subscribe(topic string, callback func(msg *model.PubSubMsg), loggerFunc LoggerFunc, validations ...ValidateMsg) error + isClustered() } type PubSubClientServiceImpl struct { @@ -35,28 +36,23 @@ type PubSubClientServiceImpl struct { logsConfig *model.LogsConfig } -func NewPubSubClientServiceImpl(logger *zap.SugaredLogger) (*PubSubClientServiceImpl, error) { +func NewPubSubClientServiceImpl(logger *zap.SugaredLogger) *PubSubClientServiceImpl { natsClient, err := NewNatsClient(logger) if err != nil { - logger.Errorw("error occurred while creating nats client stopping now!!") - return nil, err + logger.Fatalw("error occurred while creating nats client stopping now!!") } logsConfig := &model.LogsConfig{} err = env.Parse(logsConfig) if err != nil { logger.Errorw("error occurred while parsing LogsConfig", "err", err) - return nil, err - } - err = ParseAndFillStreamWiseAndConsumerWiseConfigMaps() - if err != nil { - return nil, err } + ParseAndFillStreamWiseAndConsumerWiseConfigMaps() pubSubClient := &PubSubClientServiceImpl{ Logger: logger, NatsClient: natsClient, logsConfig: logsConfig, } - return pubSubClient, nil + return pubSubClient } func (impl PubSubClientServiceImpl) Publish(topic string, msg string) error { @@ -99,6 +95,7 @@ func (impl PubSubClientServiceImpl) Publish(topic string, msg string) error { // invokes callback(+required) func for each message received. // loggerFunc(+optional) is invoked before passing the message to the callback function. // validations(+optional) methods were called before passing the message to the callback func. + func (impl PubSubClientServiceImpl) Subscribe(topic string, callback func(msg *model.PubSubMsg), loggerFunc LoggerFunc, validations ...ValidateMsg) error { impl.Logger.Infow("Subscribed to pubsub client", "topic", topic) natsTopic := GetNatsTopic(topic) @@ -132,10 +129,12 @@ func (impl PubSubClientServiceImpl) Subscribe(topic string, callback func(msg *m nats.AckWait(ackWait), // if ackWait is 0 , nats sets this option to 30secs by default nats.BindStream(streamName)) if err != nil { - impl.Logger.Errorw("error while subscribing to nats ", "stream", streamName, "topic", topic, "error", err) + impl.Logger.Fatalw("error while subscribing to nats ", "stream", streamName, "topic", topic, "error", err) return err } go impl.startListeningForEvents(processingBatchSize, channel, callback, loggerFunc, validations...) + + //time.Sleep(10 * time.Second) impl.Logger.Infow("Successfully subscribed with Nats", "stream", streamName, "topic", topic, "queue", queueName, "consumer", consumerName) return nil } @@ -148,6 +147,7 @@ func (impl PubSubClientServiceImpl) startListeningForEvents(processingBatchSize go impl.processMessages(wg, channel, callback, loggerFunc, validations...) } wg.Wait() + impl.Logger.Warn("msgs received Done from Nats side, going to end listening!!") } @@ -213,14 +213,13 @@ func (impl PubSubClientServiceImpl) TryCatchCallBack(msg *nats.Msg, callback fun // publish metrics for msg delivery count if msgDeliveryCount > 1 if msgDeliveryCount > 1 { - metrics.NatsEventDeliveryCount.WithLabelValues(msg.Subject).Observe(float64(msgDeliveryCount)) + metrics.NatsEventDeliveryCount.WithLabelValues(msg.Subject, natsMsgId).Observe(float64(msgDeliveryCount)) } // Panic recovery handling if panicInfo := recover(); panicInfo != nil { impl.Logger.Warnw(fmt.Sprintf("%s: found panic error", NATS_PANIC_MSG_LOG_PREFIX), "subject", msg.Subject, "payload", string(msg.Data), "logs", string(debug.Stack())) err = fmt.Errorf("%v\nPanic Logs:\n%s", panicInfo, string(debug.Stack())) - metrics.IncPanicRecoveryCount("nats", msg.Subject, "", "") // Publish the panic info to PANIC_ON_PROCESSING_TOPIC publishErr := impl.publishPanicError(msg, err) if publishErr != nil { @@ -242,6 +241,12 @@ func (impl PubSubClientServiceImpl) TryCatchCallBack(msg *nats.Msg, callback fun callback(subMsg) } +func (impl PubSubClientServiceImpl) isClustered(streamName string) bool { + // This is only ever set, no need for lock here. + streamInfo, _ := impl.NatsClient.JetStrCtxt.StreamInfo(streamName) + return streamInfo.Cluster != nil +} + func (impl PubSubClientServiceImpl) getStreamConfig(streamName string) *nats.StreamConfig { configJson := NatsStreamWiseConfigMapping[streamName].StreamConfig streamCfg := &nats.StreamConfig{} @@ -282,6 +287,17 @@ func (impl PubSubClientServiceImpl) updateConsumer(natsClient *NatsClient, strea existingConfig.MaxAckPending = messageBufferSize updatesDetected = true } + if replicas := overrideConfig.Replicas; replicas > 0 && existingConfig.Replicas != replicas && replicas < 5 { + if replicas > 1 && impl.isClustered(streamName) { + existingConfig.Replicas = replicas + updatesDetected = true + } else { + if replicas > 1 { + impl.Logger.Errorw("replicas >1 is not possible in non-clustered mode ") + } + } + + } if updatesDetected { _, err = natsClient.JetStrCtxt.UpdateConsumer(streamName, &existingConfig) diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go index 337217a1dc..fd7c41e5a7 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go @@ -1,41 +1,36 @@ package metrics import ( - "github.com/devtron-labs/common-lib/constants" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var NatsPublishingCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: constants.NATS_PUBLISH_COUNT, + Name: "nats_publish_count", Help: "count of successfully published events on nats", -}, []string{constants.TOPIC, constants.STATUS}) +}, []string{"topic", "status"}) var NatsConsumptionCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: constants.NATS_CONSUMPTION_COUNT, + Name: "nats_consumption_count", Help: "count of consumed events on nats ", -}, []string{constants.TOPIC}) +}, []string{"topic"}) var NatsConsumingCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: constants.NATS_CONSUMING_COUNT, + Name: "nats_consuming_count", Help: "count of nats events whose consumption is in progress", -}, []string{constants.TOPIC}) +}, []string{"topic"}) var NatsEventConsumptionTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ - Name: constants.NATS_EVENT_CONSUMPTION_TIME, -}, []string{constants.TOPIC}) + Name: "nats_event_consumption_time", +}, []string{"topic"}) var NatsEventPublishTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ - Name: constants.NATS_EVENT_PUBLISH_TIME, -}, []string{constants.TOPIC}) + Name: "nats_event_publish_time", +}, []string{"topic"}) var NatsEventDeliveryCount = promauto.NewHistogramVec(prometheus.HistogramOpts{ - Name: constants.NATS_EVENT_DELIVERY_COUNT, -}, []string{constants.TOPIC}) - -var PanicRecoveryCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: constants.PANIC_RECOVERY_COUNT, -}, []string{constants.PANIC_TYPE, constants.HOST, constants.METHOD, constants.PATH}) + Name: "nats_event_delivery_count", +}, []string{"topic", "msg_id"}) func IncPublishCount(topic, status string) { NatsPublishingCount.WithLabelValues(topic, status).Inc() @@ -48,6 +43,3 @@ func IncConsumptionCount(topic string) { func IncConsumingCount(topic string) { NatsConsumingCount.WithLabelValues(topic).Inc() } -func IncPanicRecoveryCount(panicType, host, method, path string) { - PanicRecoveryCount.WithLabelValues(panicType, host, method, path).Inc() -} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go b/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go index 7aea2c4e15..a51f41bcdc 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go @@ -17,7 +17,6 @@ limitations under the License. package utils import ( - "fmt" "math/rand" "strings" "time" @@ -35,15 +34,3 @@ func Generate(size int) string { str := b.String() return str } - -func hasScheme(url string) bool { - return len(url) >= 7 && (url[:7] == "http://" || url[:8] == "https://") -} - -func GetUrlWithScheme(url string) (urlWithScheme string) { - urlWithScheme = url - if !hasScheme(url) { - urlWithScheme = fmt.Sprintf("https://%s", url) - } - return urlWithScheme -} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go index ac06485384..1900c5452a 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go @@ -85,8 +85,7 @@ type K8sService interface { GetCoreV1ClientInCluster() (*v12.CoreV1Client, error) GetKubeVersion() (*version.Info, error) ValidateResource(resourceObj map[string]interface{}, gvk schema.GroupVersionKind, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool - BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, includeMetadata bool, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) - ValidateForResource(namespace string, resourceRef interface{}, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool + BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) GetPodByName(namespace string, name string, client *v12.CoreV1Client) (*v1.Pod, error) GetK8sInClusterRestConfig() (*rest.Config, error) GetResourceInfoByLabelSelector(ctx context.Context, namespace string, labelSelector string) (*v1.Pod, error) @@ -129,8 +128,8 @@ type K8sService interface { GetApiResources(restConfig *rest.Config, includeOnlyVerb string) ([]*K8sApiResource, error) CreateResources(ctx context.Context, restConfig *rest.Config, manifest string, gvk schema.GroupVersionKind, namespace string) (*ManifestResponse, error) PatchResourceRequest(ctx context.Context, restConfig *rest.Config, pt types.PatchType, manifest string, name string, namespace string, gvk schema.GroupVersionKind) (*ManifestResponse, error) - GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string, asTable bool, listOptions *metav1.ListOptions) (*ResourceListResponse, bool, error) - GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind, asTable bool) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) + GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string) (*ResourceListResponse, bool, error) + GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) GetPodLogs(ctx context.Context, restConfig *rest.Config, name string, namespace string, sinceTime *metav1.Time, tailLines int, sinceSeconds int, follow bool, containerName string, isPrevContainerLogsEnabled bool) (io.ReadCloser, error) ListEvents(restConfig *rest.Config, namespace string, groupVersionKind schema.GroupVersionKind, ctx context.Context, name string) (*v1.EventList, error) GetResourceIf(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) @@ -720,7 +719,7 @@ func (impl K8sServiceImpl) GetPodByName(namespace string, name string, client *v } } -func (impl K8sServiceImpl) BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, includeMetadata bool, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) { +func (impl K8sServiceImpl) BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) { clusterResourceListMap := &ClusterResourceListMap{} // build headers var headers []string @@ -799,9 +798,6 @@ func (impl K8sServiceImpl) BuildK8sObjectListTableData(manifest *unstructured.Un rowIndex[commonBean.K8sClusterResourceNamespaceKey] = namespace } } - if includeMetadata { - rowIndex[commonBean.K8sClusterResourceMetadataKey] = metadata - } } } allowed = impl.ValidateResource(cellObj, gvk, validateResourceAccess) @@ -838,7 +834,7 @@ func (impl K8sServiceImpl) ValidateResource(resourceObj map[string]interface{}, } if len(ownerReferences) > 0 { for _, ownerRef := range ownerReferences { - allowed := impl.ValidateForResource(namespace, ownerRef, validateCallback) + allowed := impl.validateForResource(namespace, ownerRef, validateCallback) if allowed { return allowed } @@ -848,7 +844,7 @@ func (impl K8sServiceImpl) ValidateResource(resourceObj map[string]interface{}, return validateCallback(namespace, groupName, resKind, resourceName) } -func (impl K8sServiceImpl) ValidateForResource(namespace string, resourceRef interface{}, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool { +func (impl K8sServiceImpl) validateForResource(namespace string, resourceRef interface{}, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool { resourceReference := resourceRef.(map[string]interface{}) resKind := resourceReference[commonBean.K8sClusterResourceKindKey].(string) apiVersion := resourceReference[commonBean.K8sClusterResourceApiVersionKey].(string) @@ -1247,7 +1243,7 @@ func (impl K8sServiceImpl) GetPodLogs(ctx context.Context, restConfig *rest.Conf } return stream, nil } -func (impl K8sServiceImpl) GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind, asTable bool) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) { +func (impl K8sServiceImpl) GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) { httpClient, err := OverrideK8sHttpClientWithTracer(restConfig) if err != nil { impl.logger.Errorw("error in getting http client", "err", err) @@ -1265,14 +1261,12 @@ func (impl K8sServiceImpl) GetResourceIfWithAcceptHeader(restConfig *rest.Config } resource := groupVersionKind.GroupVersion().WithResource(apiResource.Name) wt := restConfig.WrapTransport // Reference: https://github.com/kubernetes/client-go/issues/407 - if asTable { - restConfig.WrapTransport = func(rt http.RoundTripper) http.RoundTripper { - if wt != nil { - rt = wt(rt) - } - return &http2.HeaderAdder{ - Rt: rt, - } + restConfig.WrapTransport = func(rt http.RoundTripper) http.RoundTripper { + if wt != nil { + rt = wt(rt) + } + return &http2.HeaderAdder{ + Rt: rt, } } httpClient, err = OverrideK8sHttpClientWithTracer(restConfig) @@ -1300,25 +1294,23 @@ func ServerResourceForGroupVersionKind(discoveryClient discovery.DiscoveryInterf } return nil, errors.NewNotFound(schema.GroupResource{Group: gvk.Group, Resource: gvk.Kind}, "") } -func (impl K8sServiceImpl) GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string, asTable bool, listOptions *metav1.ListOptions) (*ResourceListResponse, bool, error) { - resourceIf, namespaced, err := impl.GetResourceIfWithAcceptHeader(restConfig, gvk, asTable) +func (impl K8sServiceImpl) GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string) (*ResourceListResponse, bool, error) { + resourceIf, namespaced, err := impl.GetResourceIfWithAcceptHeader(restConfig, gvk) if err != nil { impl.logger.Errorw("error in getting dynamic interface for resource", "err", err, "namespace", namespace) return nil, namespaced, err } var resp *unstructured.UnstructuredList - if listOptions == nil { - listOptions = &metav1.ListOptions{ - TypeMeta: metav1.TypeMeta{ - Kind: gvk.Kind, - APIVersion: gvk.GroupVersion().String(), - }, - } + listOptions := metav1.ListOptions{ + TypeMeta: metav1.TypeMeta{ + Kind: gvk.Kind, + APIVersion: gvk.GroupVersion().String(), + }, } if len(namespace) > 0 && namespaced { - resp, err = resourceIf.Namespace(namespace).List(ctx, *listOptions) + resp, err = resourceIf.Namespace(namespace).List(ctx, listOptions) } else { - resp, err = resourceIf.List(ctx, *listOptions) + resp, err = resourceIf.List(ctx, listOptions) } if err != nil { impl.logger.Errorw("error in getting resource", "err", err, "namespace", namespace) diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go index 0e5b8da2c7..75938f4ff7 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go @@ -3,7 +3,6 @@ package k8s import ( "fmt" "github.com/devtron-labs/common-lib/utils/k8sObjectsUtil" - "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -36,8 +35,13 @@ type ClusterConfig struct { CertData string CAData string ClusterId int + ProxyUrl string ToConnectForClusterVerification bool - RemoteConnectionConfig *bean.RemoteConnectionConfigBean + ToConnectWithSSHTunnel bool + SSHTunnelUser string + SSHTunnelPassword string + SSHTunnelAuthKey string + SSHTunnelServerAddress string } type ClusterResourceListMap struct { diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go index a5ef4afc54..cea57955fa 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go @@ -24,34 +24,12 @@ const ( NamespaceKind = "Namespace" HorizontalPodAutoscalerKind = "HorizontalPodAutoscaler" Spec = "spec" - Template = "template" - JobTemplate = "jobTemplate" Ports = "ports" Port = "port" Subsets = "subsets" Nodes = "nodes" - Containers = "containers" - InitContainers = "initContainers" - EphemeralContainers = "ephemeralContainers" - Image = "image" ) -var defaultContainerPath = []string{Spec, Template, Spec} -var cronJobContainerPath = []string{Spec, JobTemplate, Spec, Template, Spec} -var podContainerPath = []string{Spec} - -var kindToPath = map[string][]string{ - PodKind: podContainerPath, - K8sClusterResourceCronJobKind: cronJobContainerPath, -} - -func GetContainerSubPathForKind(kind string) []string { - if path, ok := kindToPath[kind]; ok { - return path - } - return defaultContainerPath -} - const ( PersistentVolumeClaimsResourceType = "persistentvolumeclaims" StatefulSetsResourceType = "statefulsets" diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go deleted file mode 100644 index e4a858d51f..0000000000 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go +++ /dev/null @@ -1,121 +0,0 @@ -package k8sObjectsUtil - -import ( - k8sCommonBean "github.com/devtron-labs/common-lib/utils/k8s/commonBean" - appsV1 "k8s.io/api/apps/v1" - batchV1 "k8s.io/api/batch/v1" - coreV1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -func ExtractAllDockerImages(manifests []unstructured.Unstructured) ([]string, error) { - var dockerImages []string - for _, manifest := range manifests { - switch manifest.GroupVersionKind() { - case schema.GroupVersionKind{Group: "", Version: "v1", Kind: k8sCommonBean.PodKind}: - var pod coreV1.Pod - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &pod) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(pod.Spec)...) - case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.DeploymentKind}: - var deployment appsV1.Deployment - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &deployment) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(deployment.Spec.Template.Spec)...) - case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.ReplicaSetKind}: - var replicaSet appsV1.ReplicaSet - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &replicaSet) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(replicaSet.Spec.Template.Spec)...) - case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.StatefulSetKind}: - var statefulSet appsV1.StatefulSet - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &statefulSet) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(statefulSet.Spec.Template.Spec)...) - case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.DaemonSetKind}: - var daemonSet appsV1.DaemonSet - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &daemonSet) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(daemonSet.Spec.Template.Spec)...) - case schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: k8sCommonBean.JobKind}: - var job batchV1.Job - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &job) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(job.Spec.Template.Spec)...) - case schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "CronJob"}: - var cronJob batchV1.CronJob - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &cronJob) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(cronJob.Spec.JobTemplate.Spec.Template.Spec)...) - case schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ReplicationController"}: - var replicationController coreV1.ReplicationController - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &replicationController) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromPodTemplate(replicationController.Spec.Template.Spec)...) - case schema.GroupVersionKind{Group: "argoproj.io", Version: "v1alpha1", Kind: "Rollout"}: - var rolloutSpec map[string]interface{} - err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &rolloutSpec) - if err != nil { - return nil, err - } - dockerImages = append(dockerImages, extractImagesFromRolloutTemplate(rolloutSpec)...) - } - } - - return dockerImages, nil -} - -func extractImagesFromPodTemplate(podSpec coreV1.PodSpec) []string { - var dockerImages []string - for _, container := range podSpec.Containers { - dockerImages = append(dockerImages, container.Image) - } - for _, initContainer := range podSpec.InitContainers { - dockerImages = append(dockerImages, initContainer.Image) - } - for _, ephContainer := range podSpec.EphemeralContainers { - dockerImages = append(dockerImages, ephContainer.Image) - } - - return dockerImages -} - -func extractImagesFromRolloutTemplate(rolloutSpec map[string]interface{}) []string { - var dockerImages []string - if rolloutSpec != nil && rolloutSpec["spec"] != nil { - spec := rolloutSpec["spec"].(map[string]interface{}) - if spec != nil && spec["template"] != nil { - template := spec["template"].(map[string]interface{}) - if template != nil && template["spec"] != nil { - templateSpec := template["spec"].(map[string]interface{}) - if templateSpec != nil && templateSpec["containers"] != nil { - containers := templateSpec["containers"].([]interface{}) - for _, item := range containers { - container := item.(map[string]interface{}) - images := container["image"].(interface{}) - dockerImages = append(dockerImages, images.(string)) - } - } - } - } - } - return dockerImages -} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go deleted file mode 100644 index 54700f2433..0000000000 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go +++ /dev/null @@ -1,51 +0,0 @@ -package k8sObjectsUtil - -import ( - "github.com/devtron-labs/common-lib/utils/k8s/commonBean" - yamlUtil "github.com/devtron-labs/common-lib/utils/yaml" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -func getPath(item string, path []string) []string { - return append(path, item) -} - -func ExtractImages(obj unstructured.Unstructured) []string { - images := make([]string, 0) - - subPath := commonBean.GetContainerSubPathForKind(obj.GetKind()) - allContainers := make([]interface{}, 0) - containers, _, _ := unstructured.NestedSlice(obj.Object, getPath(commonBean.Containers, subPath)...) - if len(containers) > 0 { - allContainers = append(allContainers, containers...) - } - iContainers, _, _ := unstructured.NestedSlice(obj.Object, getPath(commonBean.InitContainers, subPath)...) - if len(iContainers) > 0 { - allContainers = append(allContainers, iContainers...) - } - ephContainers, _, _ := unstructured.NestedSlice(obj.Object, getPath(commonBean.EphemeralContainers, subPath)...) - if len(ephContainers) > 0 { - allContainers = append(allContainers, ephContainers...) - } - for _, container := range allContainers { - containerMap := container.(map[string]interface{}) - if image, ok := containerMap[commonBean.Image].(string); ok { - images = append(images, image) - } - } - return images -} - -func ExtractImageFromManifestYaml(manifestYaml string) []string { - var dockerImagesFinal []string - parsedManifests, err := yamlUtil.SplitYAMLs([]byte(manifestYaml)) - if err != nil { - - return dockerImagesFinal - } - for _, manifest := range parsedManifests { - dockerImages := ExtractImages(manifest) - dockerImagesFinal = append(dockerImagesFinal, dockerImages...) - } - return dockerImagesFinal -} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go deleted file mode 100644 index 15fedc710d..0000000000 --- a/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go +++ /dev/null @@ -1,48 +0,0 @@ -package bean - -type RemoteConnectionMethod string - -const ( - RemoteConnectionMethodProxy RemoteConnectionMethod = "PROXY" - RemoteConnectionMethodSSH RemoteConnectionMethod = "SSH" - RemoteConnectionMethodDirect RemoteConnectionMethod = "DIRECT" -) - -type ConnectionMethod string - -const ( - ConnectionMethod_Proxy ConnectionMethod = "PROXY" - ConnectionMethod_SSH ConnectionMethod = "SSH" -) - -type ProxyConfig struct { - ProxyUrl string `json:"proxyUrl,omitempty"` -} - -type SSHTunnelConfig struct { - SSHServerAddress string `json:"sshServerAddress,omitempty"` - SSHUsername string `json:"sshUsername,omitempty"` - SSHPassword string `json:"sshPassword,omitempty"` - SSHAuthKey string `json:"sshAuthKey,omitempty"` -} - -type RemoteConnectionConfigBean struct { - RemoteConnectionConfigId int `json:"remoteConnectionConfigId"` - ConnectionMethod RemoteConnectionMethod `json:"connectionMethod,omitempty"` - ProxyConfig *ProxyConfig `json:"proxyConfig,omitempty"` - SSHTunnelConfig *SSHTunnelConfig `json:"sshConfig,omitempty"` -} - -type RegistryConfig struct { - RegistryId string - RegistryUrl string - RegistryUsername string - RegistryPassword string - RegistryConnectionType string //secure, insecure, secure-with-cert - RegistryCertificateString string - RegistryCAFilePath string - IsPublicRegistry bool - ConnectionMethod ConnectionMethod //ssh, proxy - ProxyConfig *ProxyConfig - SSHConfig *SSHTunnelConfig -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 8bb7b79ff6..55bfeb0206 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -377,7 +377,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694 +# github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8 ## explicit; go 1.20 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/cloud-provider-identifier @@ -395,7 +395,6 @@ github.com/devtron-labs/common-lib/utils/k8s github.com/devtron-labs/common-lib/utils/k8s/commonBean github.com/devtron-labs/common-lib/utils/k8s/health github.com/devtron-labs/common-lib/utils/k8sObjectsUtil -github.com/devtron-labs/common-lib/utils/remoteConnection/bean github.com/devtron-labs/common-lib/utils/yaml # github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 ## explicit; go 1.17 From a7f614c48f42c6343f3cdd299b7057a2dd3188c1 Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Tue, 28 May 2024 14:08:59 +0530 Subject: [PATCH 2/8] chore: wire --- client/events/EventClient.go | 1 - cmd/external-app/wire_gen.go | 2 +- wire_gen.go | 7 ++----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/client/events/EventClient.go b/client/events/EventClient.go index fcd969fd9d..4cfbf79661 100644 --- a/client/events/EventClient.go +++ b/client/events/EventClient.go @@ -55,7 +55,6 @@ func GetEventClientConfig() (*EventClientConfig, error) { type EventClient interface { WriteNotificationEvent(event Event) (bool, error) - sendEventOnNats(event Event) WriteNatsEvent(channel string, payload interface{}) error } diff --git a/cmd/external-app/wire_gen.go b/cmd/external-app/wire_gen.go index d4e7974bb9..4af92e771b 100644 --- a/cmd/external-app/wire_gen.go +++ b/cmd/external-app/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/wire_gen.go b/wire_gen.go index 6712526b9e..370e4caa56 100644 --- a/wire_gen.go +++ b/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject @@ -368,10 +368,7 @@ func InitializeApp() (*App, error) { if err != nil { return nil, err } - pubSubClientServiceImpl, err := pubsub_lib.NewPubSubClientServiceImpl(sugaredLogger) - if err != nil { - return nil, err - } + pubSubClientServiceImpl := pubsub_lib.NewPubSubClientServiceImpl(sugaredLogger) ciPipelineRepositoryImpl := pipelineConfig.NewCiPipelineRepositoryImpl(db, sugaredLogger, transactionUtilImpl) moduleActionAuditLogRepositoryImpl := module.NewModuleActionAuditLogRepositoryImpl(db) serverCacheServiceImpl, err := server.NewServerCacheServiceImpl(sugaredLogger, serverEnvConfigServerEnvConfig, serverDataStoreServerDataStore, helmAppServiceImpl) From 552c0d323fcc293062ec99bd22444c45793cbbdc Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Tue, 28 May 2024 16:13:19 +0530 Subject: [PATCH 3/8] chore: run test case again after updating common lib by taking merge --- client/events/event_test.go | 2 +- go.mod | 2 +- go.sum | 4 +- .../blob-storage/BlobStorageService.go | 3 +- .../common-lib/constants/constants.go | 22 ++++ .../common-lib/middlewares/recovery.go | 2 + .../common-lib/pubsub-lib/JetStreamUtil.go | 17 ++- .../pubsub-lib/PubSubClientService.go | 18 ++- .../common-lib/pubsub-lib/metrics/metrics.go | 32 +++-- .../common-lib/utils/CommonUtils.go | 13 ++ .../common-lib/utils/k8s/K8sUtil.go | 52 ++++---- .../devtron-labs/common-lib/utils/k8s/bean.go | 8 +- .../common-lib/utils/k8s/commonBean/bean.go | 22 ++++ .../utils/k8sObjectsUtil/DockerImageFinder.go | 121 ++++++++++++++++++ .../utils/k8sObjectsUtil/ImageUtil.go | 51 ++++++++ .../utils/remoteConnection/bean/bean.go | 48 +++++++ vendor/modules.txt | 3 +- 17 files changed, 363 insertions(+), 57 deletions(-) create mode 100644 vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go create mode 100644 vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go create mode 100644 vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go diff --git a/client/events/event_test.go b/client/events/event_test.go index a72f88f9cd..a7d1a05866 100644 --- a/client/events/event_test.go +++ b/client/events/event_test.go @@ -14,7 +14,7 @@ func TestSendEventsOnNats(t *testing.T) { logger, err := util.NewSugardLogger() //nats, err := pubsub_lib.NewNatsClient(logger) //mockPubsubClient := NewPubSubClientServiceImpl(logger) - mockPubsubClient := pubsub_lib.NewPubSubClientServiceImpl(logger) + mockPubsubClient, err := pubsub_lib.NewPubSubClientServiceImpl(logger) client := util.NewHttpClient() config := sql.Config{} db, err := sql.NewDbConnection(&config, logger) diff --git a/go.mod b/go.mod index 97868b1a19..2de97c4f5c 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 - github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8 + github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 github.com/evanphx/json-patch v5.6.0+incompatible github.com/gammazero/workerpool v1.1.3 diff --git a/go.sum b/go.sum index e62c2db1b2..1aad577cc5 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADG github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 h1:AUTYcDnL6w6Ux+264VldYaOUQAP6pDZ5Tq8wCKJyiEg= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470/go.mod h1:JQxTCMmQisrpjzETJr0tzVadV+wW23rHEZAY7JVyK3s= -github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8 h1:xZhRjWZR7koFQZyt2obfpX6HxRrjiwXUXundPP05Pok= -github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8/go.mod h1:mzEk3pf4JDXsOPNvCxjoSnsMBTwmt4A73Qc2tobLkZM= +github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba h1:ga3jPERHNyVg2u47NjOCZ9f7uYRtBtNT20AW2VMVT7k= +github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 h1:TElPRU69QedW7DIQiiQxtjwSQ6cK0fCTAMGvSLhP0ac= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534/go.mod h1:ypUknVph8Ph4dxSlrFoouf7wLedQxHku2LQwgRrdgS4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go index 9288d1bacb..7a8321b187 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go @@ -57,7 +57,8 @@ func (impl *BlobStorageServiceImpl) Get(request *BlobStorageRequest) (bool, int6 file, err := os.Create("/" + request.DestinationKey) defer file.Close() if err != nil { - log.Fatal(err) + log.Println(err) + return false, 0, err } switch request.StorageType { case BLOB_STORAGE_S3: diff --git a/vendor/github.com/devtron-labs/common-lib/constants/constants.go b/vendor/github.com/devtron-labs/common-lib/constants/constants.go index a7e41944da..6ea4e161dc 100644 --- a/vendor/github.com/devtron-labs/common-lib/constants/constants.go +++ b/vendor/github.com/devtron-labs/common-lib/constants/constants.go @@ -1,3 +1,25 @@ package constants const PanicLogIdentifier = "DEVTRON_PANIC_RECOVER" + +// metrics name constants + +const ( + NATS_PUBLISH_COUNT = "Nats_Publish_Count" + NATS_CONSUMPTION_COUNT = "Nats_Consumption_Count" + NATS_CONSUMING_COUNT = "Nats_Consuming_Count" + NATS_EVENT_CONSUMPTION_TIME = "Nats_Event_Consumption_Time" + NATS_EVENT_PUBLISH_TIME = "Nats_Event_Publish_Time" + NATS_EVENT_DELIVERY_COUNT = "Nats_Event_Delivery_Count" + PANIC_RECOVERY_COUNT = "Panic_Recovery_Count" +) + +// metrcis lables constant +const ( + PANIC_TYPE = "panicType" + HOST = "host" + METHOD = "method" + PATH = "path" + TOPIC = "topic" + STATUS = "status" +) diff --git a/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go b/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go index 6834f61727..804fbcb5b9 100644 --- a/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go +++ b/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go @@ -3,6 +3,7 @@ package middlewares import ( "encoding/json" "github.com/devtron-labs/common-lib/constants" + "github.com/devtron-labs/common-lib/pubsub-lib/metrics" "log" "net/http" "runtime/debug" @@ -14,6 +15,7 @@ func Recovery(next http.Handler) http.Handler { defer func() { err := recover() if err != nil { + metrics.IncPanicRecoveryCount("handler", r.Host, r.Method, r.RequestURI) log.Print(constants.PanicLogIdentifier, "recovered from panic", "err", err, "stack", string(debug.Stack())) jsonBody, _ := json.Marshal(map[string]string{ "error": "internal server error", diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go index 93a1660253..f780dde05c 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go @@ -101,6 +101,9 @@ const ( CD_PIPELINE_DELETE_EVENT_TOPIC string = "CD-PIPELINE-DELETE-EVENT" CD_PIPELINE_DELETE_EVENT_GROUP string = "CD-PIPELINE-DELETE-EVENT-GROUP" CD_PIPELINE_DELETE_EVENT_DURABLE string = "CD-PIPELINE-DELETE-EVENT-DURABLE" + CHART_SCAN_TOPIC string = "CHART-SCAN-TOPIC" + CHART_SCAN_GROUP string = "CHART-SCAN-GROUP" + CHART_SCAN_DURABLE string = "CHART-SCAN-DURABLE" NOTIFICATION_EVENT_TOPIC string = "NOTIFICATION_EVENT_TOPIC" NOTIFICATION_EVENT_GROUP string = "NOTIFICATION_EVENT_GROUP" NOTIFICATION_EVENT_DURABLE string = "NOTIFICATION_EVENT_DURABLE" @@ -112,7 +115,6 @@ type NatsTopic struct { queueName string // needed for load balancing consumerName string } - type ConfigJson struct { // StreamConfigJson is a json string of map[string]NatsStreamConfig StreamConfigJson string `env:"STREAM_CONFIG_JSON"` @@ -152,6 +154,7 @@ var natsTopicMapping = map[string]NatsTopic{ CD_PIPELINE_DELETE_EVENT_TOPIC: {topicName: CD_PIPELINE_DELETE_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CD_PIPELINE_DELETE_EVENT_GROUP, consumerName: CD_PIPELINE_DELETE_EVENT_DURABLE}, NOTIFICATION_EVENT_TOPIC: {topicName: NOTIFICATION_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: NOTIFICATION_EVENT_GROUP, consumerName: NOTIFICATION_EVENT_DURABLE}, + CHART_SCAN_TOPIC: {topicName: CHART_SCAN_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CHART_SCAN_GROUP, consumerName: CHART_SCAN_DURABLE}, } var NatsStreamWiseConfigMapping = map[string]NatsStreamConfig{ @@ -230,11 +233,12 @@ func getStreamConfigMap(jsonString string) map[string]NatsStreamConfig { return resMap } -func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { +func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() error { configJson := ConfigJson{} err := env.Parse(&configJson) if err != nil { - log.Fatal("error while parsing config from environment params", " err", err) + log.Println("error while parsing config from environment params", " err", err) + return err } // fetch the consumer configs that were given explicitly in the configJson.ConsumerConfigJson @@ -247,6 +251,7 @@ func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { err = env.Parse(&defaultConfig) if err != nil { log.Print("error while parsing config from environment params", "err", err) + return err } // default stream and consumer config values @@ -258,6 +263,7 @@ func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { // initialise all the stream wise config with default values or user defined values updateNatsStreamConfigMapping(defaultStreamConfigVal, streamConfigMap) + return nil } func updateNatsConsumerConfigMapping(defaultConsumerConfigVal NatsConsumerConfig, consumerConfigMap map[string]NatsConsumerConfig) { @@ -312,11 +318,12 @@ func AddStream(js nats.JetStreamContext, streamConfig *nats.StreamConfig, stream cfgToSet := getNewConfig(streamName, streamConfig) _, err = js.AddStream(cfgToSet) if err != nil { - log.Fatal("Error while creating stream. ", "stream name: ", streamName, "error: ", err) + log.Println("Error while creating stream. ", "stream name: ", streamName, "error: ", err) return err } } else if err != nil { - log.Fatal("Error while getting stream info. ", "stream name: ", streamName, "error: ", err) + log.Println("Error while getting stream info. ", "stream name: ", streamName, "error: ", err) + return err } else { config := streamInfo.Config streamConfig.Name = streamName diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go index 4d08a0b662..f311d35b91 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go @@ -36,23 +36,28 @@ type PubSubClientServiceImpl struct { logsConfig *model.LogsConfig } -func NewPubSubClientServiceImpl(logger *zap.SugaredLogger) *PubSubClientServiceImpl { +func NewPubSubClientServiceImpl(logger *zap.SugaredLogger) (*PubSubClientServiceImpl, error) { natsClient, err := NewNatsClient(logger) if err != nil { - logger.Fatalw("error occurred while creating nats client stopping now!!") + logger.Errorw("error occurred while creating nats client stopping now!!") + return nil, err } logsConfig := &model.LogsConfig{} err = env.Parse(logsConfig) if err != nil { logger.Errorw("error occurred while parsing LogsConfig", "err", err) + return nil, err + } + err = ParseAndFillStreamWiseAndConsumerWiseConfigMaps() + if err != nil { + return nil, err } - ParseAndFillStreamWiseAndConsumerWiseConfigMaps() pubSubClient := &PubSubClientServiceImpl{ Logger: logger, NatsClient: natsClient, logsConfig: logsConfig, } - return pubSubClient + return pubSubClient, nil } func (impl PubSubClientServiceImpl) Publish(topic string, msg string) error { @@ -129,7 +134,7 @@ func (impl PubSubClientServiceImpl) Subscribe(topic string, callback func(msg *m nats.AckWait(ackWait), // if ackWait is 0 , nats sets this option to 30secs by default nats.BindStream(streamName)) if err != nil { - impl.Logger.Fatalw("error while subscribing to nats ", "stream", streamName, "topic", topic, "error", err) + impl.Logger.Errorw("error while subscribing to nats ", "stream", streamName, "topic", topic, "error", err) return err } go impl.startListeningForEvents(processingBatchSize, channel, callback, loggerFunc, validations...) @@ -213,13 +218,14 @@ func (impl PubSubClientServiceImpl) TryCatchCallBack(msg *nats.Msg, callback fun // publish metrics for msg delivery count if msgDeliveryCount > 1 if msgDeliveryCount > 1 { - metrics.NatsEventDeliveryCount.WithLabelValues(msg.Subject, natsMsgId).Observe(float64(msgDeliveryCount)) + metrics.NatsEventDeliveryCount.WithLabelValues(msg.Subject).Observe(float64(msgDeliveryCount)) } // Panic recovery handling if panicInfo := recover(); panicInfo != nil { impl.Logger.Warnw(fmt.Sprintf("%s: found panic error", NATS_PANIC_MSG_LOG_PREFIX), "subject", msg.Subject, "payload", string(msg.Data), "logs", string(debug.Stack())) err = fmt.Errorf("%v\nPanic Logs:\n%s", panicInfo, string(debug.Stack())) + metrics.IncPanicRecoveryCount("nats", msg.Subject, "", "") // Publish the panic info to PANIC_ON_PROCESSING_TOPIC publishErr := impl.publishPanicError(msg, err) if publishErr != nil { diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go index fd7c41e5a7..337217a1dc 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go @@ -1,36 +1,41 @@ package metrics import ( + "github.com/devtron-labs/common-lib/constants" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) var NatsPublishingCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "nats_publish_count", + Name: constants.NATS_PUBLISH_COUNT, Help: "count of successfully published events on nats", -}, []string{"topic", "status"}) +}, []string{constants.TOPIC, constants.STATUS}) var NatsConsumptionCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "nats_consumption_count", + Name: constants.NATS_CONSUMPTION_COUNT, Help: "count of consumed events on nats ", -}, []string{"topic"}) +}, []string{constants.TOPIC}) var NatsConsumingCount = promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "nats_consuming_count", + Name: constants.NATS_CONSUMING_COUNT, Help: "count of nats events whose consumption is in progress", -}, []string{"topic"}) +}, []string{constants.TOPIC}) var NatsEventConsumptionTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ - Name: "nats_event_consumption_time", -}, []string{"topic"}) + Name: constants.NATS_EVENT_CONSUMPTION_TIME, +}, []string{constants.TOPIC}) var NatsEventPublishTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ - Name: "nats_event_publish_time", -}, []string{"topic"}) + Name: constants.NATS_EVENT_PUBLISH_TIME, +}, []string{constants.TOPIC}) var NatsEventDeliveryCount = promauto.NewHistogramVec(prometheus.HistogramOpts{ - Name: "nats_event_delivery_count", -}, []string{"topic", "msg_id"}) + Name: constants.NATS_EVENT_DELIVERY_COUNT, +}, []string{constants.TOPIC}) + +var PanicRecoveryCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Name: constants.PANIC_RECOVERY_COUNT, +}, []string{constants.PANIC_TYPE, constants.HOST, constants.METHOD, constants.PATH}) func IncPublishCount(topic, status string) { NatsPublishingCount.WithLabelValues(topic, status).Inc() @@ -43,3 +48,6 @@ func IncConsumptionCount(topic string) { func IncConsumingCount(topic string) { NatsConsumingCount.WithLabelValues(topic).Inc() } +func IncPanicRecoveryCount(panicType, host, method, path string) { + PanicRecoveryCount.WithLabelValues(panicType, host, method, path).Inc() +} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go b/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go index a51f41bcdc..7aea2c4e15 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go @@ -17,6 +17,7 @@ limitations under the License. package utils import ( + "fmt" "math/rand" "strings" "time" @@ -34,3 +35,15 @@ func Generate(size int) string { str := b.String() return str } + +func hasScheme(url string) bool { + return len(url) >= 7 && (url[:7] == "http://" || url[:8] == "https://") +} + +func GetUrlWithScheme(url string) (urlWithScheme string) { + urlWithScheme = url + if !hasScheme(url) { + urlWithScheme = fmt.Sprintf("https://%s", url) + } + return urlWithScheme +} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go index 1900c5452a..ac06485384 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go @@ -85,7 +85,8 @@ type K8sService interface { GetCoreV1ClientInCluster() (*v12.CoreV1Client, error) GetKubeVersion() (*version.Info, error) ValidateResource(resourceObj map[string]interface{}, gvk schema.GroupVersionKind, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool - BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) + BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, includeMetadata bool, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) + ValidateForResource(namespace string, resourceRef interface{}, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool GetPodByName(namespace string, name string, client *v12.CoreV1Client) (*v1.Pod, error) GetK8sInClusterRestConfig() (*rest.Config, error) GetResourceInfoByLabelSelector(ctx context.Context, namespace string, labelSelector string) (*v1.Pod, error) @@ -128,8 +129,8 @@ type K8sService interface { GetApiResources(restConfig *rest.Config, includeOnlyVerb string) ([]*K8sApiResource, error) CreateResources(ctx context.Context, restConfig *rest.Config, manifest string, gvk schema.GroupVersionKind, namespace string) (*ManifestResponse, error) PatchResourceRequest(ctx context.Context, restConfig *rest.Config, pt types.PatchType, manifest string, name string, namespace string, gvk schema.GroupVersionKind) (*ManifestResponse, error) - GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string) (*ResourceListResponse, bool, error) - GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) + GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string, asTable bool, listOptions *metav1.ListOptions) (*ResourceListResponse, bool, error) + GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind, asTable bool) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) GetPodLogs(ctx context.Context, restConfig *rest.Config, name string, namespace string, sinceTime *metav1.Time, tailLines int, sinceSeconds int, follow bool, containerName string, isPrevContainerLogsEnabled bool) (io.ReadCloser, error) ListEvents(restConfig *rest.Config, namespace string, groupVersionKind schema.GroupVersionKind, ctx context.Context, name string) (*v1.EventList, error) GetResourceIf(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) @@ -719,7 +720,7 @@ func (impl K8sServiceImpl) GetPodByName(namespace string, name string, client *v } } -func (impl K8sServiceImpl) BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) { +func (impl K8sServiceImpl) BuildK8sObjectListTableData(manifest *unstructured.UnstructuredList, namespaced bool, gvk schema.GroupVersionKind, includeMetadata bool, validateResourceAccess func(namespace string, group string, kind string, resourceName string) bool) (*ClusterResourceListMap, error) { clusterResourceListMap := &ClusterResourceListMap{} // build headers var headers []string @@ -798,6 +799,9 @@ func (impl K8sServiceImpl) BuildK8sObjectListTableData(manifest *unstructured.Un rowIndex[commonBean.K8sClusterResourceNamespaceKey] = namespace } } + if includeMetadata { + rowIndex[commonBean.K8sClusterResourceMetadataKey] = metadata + } } } allowed = impl.ValidateResource(cellObj, gvk, validateResourceAccess) @@ -834,7 +838,7 @@ func (impl K8sServiceImpl) ValidateResource(resourceObj map[string]interface{}, } if len(ownerReferences) > 0 { for _, ownerRef := range ownerReferences { - allowed := impl.validateForResource(namespace, ownerRef, validateCallback) + allowed := impl.ValidateForResource(namespace, ownerRef, validateCallback) if allowed { return allowed } @@ -844,7 +848,7 @@ func (impl K8sServiceImpl) ValidateResource(resourceObj map[string]interface{}, return validateCallback(namespace, groupName, resKind, resourceName) } -func (impl K8sServiceImpl) validateForResource(namespace string, resourceRef interface{}, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool { +func (impl K8sServiceImpl) ValidateForResource(namespace string, resourceRef interface{}, validateCallback func(namespace string, group string, kind string, resourceName string) bool) bool { resourceReference := resourceRef.(map[string]interface{}) resKind := resourceReference[commonBean.K8sClusterResourceKindKey].(string) apiVersion := resourceReference[commonBean.K8sClusterResourceApiVersionKey].(string) @@ -1243,7 +1247,7 @@ func (impl K8sServiceImpl) GetPodLogs(ctx context.Context, restConfig *rest.Conf } return stream, nil } -func (impl K8sServiceImpl) GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) { +func (impl K8sServiceImpl) GetResourceIfWithAcceptHeader(restConfig *rest.Config, groupVersionKind schema.GroupVersionKind, asTable bool) (resourceIf dynamic.NamespaceableResourceInterface, namespaced bool, err error) { httpClient, err := OverrideK8sHttpClientWithTracer(restConfig) if err != nil { impl.logger.Errorw("error in getting http client", "err", err) @@ -1261,12 +1265,14 @@ func (impl K8sServiceImpl) GetResourceIfWithAcceptHeader(restConfig *rest.Config } resource := groupVersionKind.GroupVersion().WithResource(apiResource.Name) wt := restConfig.WrapTransport // Reference: https://github.com/kubernetes/client-go/issues/407 - restConfig.WrapTransport = func(rt http.RoundTripper) http.RoundTripper { - if wt != nil { - rt = wt(rt) - } - return &http2.HeaderAdder{ - Rt: rt, + if asTable { + restConfig.WrapTransport = func(rt http.RoundTripper) http.RoundTripper { + if wt != nil { + rt = wt(rt) + } + return &http2.HeaderAdder{ + Rt: rt, + } } } httpClient, err = OverrideK8sHttpClientWithTracer(restConfig) @@ -1294,23 +1300,25 @@ func ServerResourceForGroupVersionKind(discoveryClient discovery.DiscoveryInterf } return nil, errors.NewNotFound(schema.GroupResource{Group: gvk.Group, Resource: gvk.Kind}, "") } -func (impl K8sServiceImpl) GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string) (*ResourceListResponse, bool, error) { - resourceIf, namespaced, err := impl.GetResourceIfWithAcceptHeader(restConfig, gvk) +func (impl K8sServiceImpl) GetResourceList(ctx context.Context, restConfig *rest.Config, gvk schema.GroupVersionKind, namespace string, asTable bool, listOptions *metav1.ListOptions) (*ResourceListResponse, bool, error) { + resourceIf, namespaced, err := impl.GetResourceIfWithAcceptHeader(restConfig, gvk, asTable) if err != nil { impl.logger.Errorw("error in getting dynamic interface for resource", "err", err, "namespace", namespace) return nil, namespaced, err } var resp *unstructured.UnstructuredList - listOptions := metav1.ListOptions{ - TypeMeta: metav1.TypeMeta{ - Kind: gvk.Kind, - APIVersion: gvk.GroupVersion().String(), - }, + if listOptions == nil { + listOptions = &metav1.ListOptions{ + TypeMeta: metav1.TypeMeta{ + Kind: gvk.Kind, + APIVersion: gvk.GroupVersion().String(), + }, + } } if len(namespace) > 0 && namespaced { - resp, err = resourceIf.Namespace(namespace).List(ctx, listOptions) + resp, err = resourceIf.Namespace(namespace).List(ctx, *listOptions) } else { - resp, err = resourceIf.List(ctx, listOptions) + resp, err = resourceIf.List(ctx, *listOptions) } if err != nil { impl.logger.Errorw("error in getting resource", "err", err, "namespace", namespace) diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go index 75938f4ff7..0e5b8da2c7 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go @@ -3,6 +3,7 @@ package k8s import ( "fmt" "github.com/devtron-labs/common-lib/utils/k8sObjectsUtil" + "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" v1 "k8s.io/api/core/v1" v12 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -35,13 +36,8 @@ type ClusterConfig struct { CertData string CAData string ClusterId int - ProxyUrl string ToConnectForClusterVerification bool - ToConnectWithSSHTunnel bool - SSHTunnelUser string - SSHTunnelPassword string - SSHTunnelAuthKey string - SSHTunnelServerAddress string + RemoteConnectionConfig *bean.RemoteConnectionConfigBean } type ClusterResourceListMap struct { diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go index cea57955fa..a5ef4afc54 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go @@ -24,12 +24,34 @@ const ( NamespaceKind = "Namespace" HorizontalPodAutoscalerKind = "HorizontalPodAutoscaler" Spec = "spec" + Template = "template" + JobTemplate = "jobTemplate" Ports = "ports" Port = "port" Subsets = "subsets" Nodes = "nodes" + Containers = "containers" + InitContainers = "initContainers" + EphemeralContainers = "ephemeralContainers" + Image = "image" ) +var defaultContainerPath = []string{Spec, Template, Spec} +var cronJobContainerPath = []string{Spec, JobTemplate, Spec, Template, Spec} +var podContainerPath = []string{Spec} + +var kindToPath = map[string][]string{ + PodKind: podContainerPath, + K8sClusterResourceCronJobKind: cronJobContainerPath, +} + +func GetContainerSubPathForKind(kind string) []string { + if path, ok := kindToPath[kind]; ok { + return path + } + return defaultContainerPath +} + const ( PersistentVolumeClaimsResourceType = "persistentvolumeclaims" StatefulSetsResourceType = "statefulsets" diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go new file mode 100644 index 0000000000..e4a858d51f --- /dev/null +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go @@ -0,0 +1,121 @@ +package k8sObjectsUtil + +import ( + k8sCommonBean "github.com/devtron-labs/common-lib/utils/k8s/commonBean" + appsV1 "k8s.io/api/apps/v1" + batchV1 "k8s.io/api/batch/v1" + coreV1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +func ExtractAllDockerImages(manifests []unstructured.Unstructured) ([]string, error) { + var dockerImages []string + for _, manifest := range manifests { + switch manifest.GroupVersionKind() { + case schema.GroupVersionKind{Group: "", Version: "v1", Kind: k8sCommonBean.PodKind}: + var pod coreV1.Pod + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &pod) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(pod.Spec)...) + case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.DeploymentKind}: + var deployment appsV1.Deployment + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &deployment) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(deployment.Spec.Template.Spec)...) + case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.ReplicaSetKind}: + var replicaSet appsV1.ReplicaSet + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &replicaSet) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(replicaSet.Spec.Template.Spec)...) + case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.StatefulSetKind}: + var statefulSet appsV1.StatefulSet + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &statefulSet) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(statefulSet.Spec.Template.Spec)...) + case schema.GroupVersionKind{Group: "apps", Version: "v1", Kind: k8sCommonBean.DaemonSetKind}: + var daemonSet appsV1.DaemonSet + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &daemonSet) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(daemonSet.Spec.Template.Spec)...) + case schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: k8sCommonBean.JobKind}: + var job batchV1.Job + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &job) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(job.Spec.Template.Spec)...) + case schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "CronJob"}: + var cronJob batchV1.CronJob + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &cronJob) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(cronJob.Spec.JobTemplate.Spec.Template.Spec)...) + case schema.GroupVersionKind{Group: "", Version: "v1", Kind: "ReplicationController"}: + var replicationController coreV1.ReplicationController + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &replicationController) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromPodTemplate(replicationController.Spec.Template.Spec)...) + case schema.GroupVersionKind{Group: "argoproj.io", Version: "v1alpha1", Kind: "Rollout"}: + var rolloutSpec map[string]interface{} + err := runtime.DefaultUnstructuredConverter.FromUnstructured(manifest.UnstructuredContent(), &rolloutSpec) + if err != nil { + return nil, err + } + dockerImages = append(dockerImages, extractImagesFromRolloutTemplate(rolloutSpec)...) + } + } + + return dockerImages, nil +} + +func extractImagesFromPodTemplate(podSpec coreV1.PodSpec) []string { + var dockerImages []string + for _, container := range podSpec.Containers { + dockerImages = append(dockerImages, container.Image) + } + for _, initContainer := range podSpec.InitContainers { + dockerImages = append(dockerImages, initContainer.Image) + } + for _, ephContainer := range podSpec.EphemeralContainers { + dockerImages = append(dockerImages, ephContainer.Image) + } + + return dockerImages +} + +func extractImagesFromRolloutTemplate(rolloutSpec map[string]interface{}) []string { + var dockerImages []string + if rolloutSpec != nil && rolloutSpec["spec"] != nil { + spec := rolloutSpec["spec"].(map[string]interface{}) + if spec != nil && spec["template"] != nil { + template := spec["template"].(map[string]interface{}) + if template != nil && template["spec"] != nil { + templateSpec := template["spec"].(map[string]interface{}) + if templateSpec != nil && templateSpec["containers"] != nil { + containers := templateSpec["containers"].([]interface{}) + for _, item := range containers { + container := item.(map[string]interface{}) + images := container["image"].(interface{}) + dockerImages = append(dockerImages, images.(string)) + } + } + } + } + } + return dockerImages +} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go new file mode 100644 index 0000000000..54700f2433 --- /dev/null +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go @@ -0,0 +1,51 @@ +package k8sObjectsUtil + +import ( + "github.com/devtron-labs/common-lib/utils/k8s/commonBean" + yamlUtil "github.com/devtron-labs/common-lib/utils/yaml" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +func getPath(item string, path []string) []string { + return append(path, item) +} + +func ExtractImages(obj unstructured.Unstructured) []string { + images := make([]string, 0) + + subPath := commonBean.GetContainerSubPathForKind(obj.GetKind()) + allContainers := make([]interface{}, 0) + containers, _, _ := unstructured.NestedSlice(obj.Object, getPath(commonBean.Containers, subPath)...) + if len(containers) > 0 { + allContainers = append(allContainers, containers...) + } + iContainers, _, _ := unstructured.NestedSlice(obj.Object, getPath(commonBean.InitContainers, subPath)...) + if len(iContainers) > 0 { + allContainers = append(allContainers, iContainers...) + } + ephContainers, _, _ := unstructured.NestedSlice(obj.Object, getPath(commonBean.EphemeralContainers, subPath)...) + if len(ephContainers) > 0 { + allContainers = append(allContainers, ephContainers...) + } + for _, container := range allContainers { + containerMap := container.(map[string]interface{}) + if image, ok := containerMap[commonBean.Image].(string); ok { + images = append(images, image) + } + } + return images +} + +func ExtractImageFromManifestYaml(manifestYaml string) []string { + var dockerImagesFinal []string + parsedManifests, err := yamlUtil.SplitYAMLs([]byte(manifestYaml)) + if err != nil { + + return dockerImagesFinal + } + for _, manifest := range parsedManifests { + dockerImages := ExtractImages(manifest) + dockerImagesFinal = append(dockerImagesFinal, dockerImages...) + } + return dockerImagesFinal +} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go new file mode 100644 index 0000000000..15fedc710d --- /dev/null +++ b/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go @@ -0,0 +1,48 @@ +package bean + +type RemoteConnectionMethod string + +const ( + RemoteConnectionMethodProxy RemoteConnectionMethod = "PROXY" + RemoteConnectionMethodSSH RemoteConnectionMethod = "SSH" + RemoteConnectionMethodDirect RemoteConnectionMethod = "DIRECT" +) + +type ConnectionMethod string + +const ( + ConnectionMethod_Proxy ConnectionMethod = "PROXY" + ConnectionMethod_SSH ConnectionMethod = "SSH" +) + +type ProxyConfig struct { + ProxyUrl string `json:"proxyUrl,omitempty"` +} + +type SSHTunnelConfig struct { + SSHServerAddress string `json:"sshServerAddress,omitempty"` + SSHUsername string `json:"sshUsername,omitempty"` + SSHPassword string `json:"sshPassword,omitempty"` + SSHAuthKey string `json:"sshAuthKey,omitempty"` +} + +type RemoteConnectionConfigBean struct { + RemoteConnectionConfigId int `json:"remoteConnectionConfigId"` + ConnectionMethod RemoteConnectionMethod `json:"connectionMethod,omitempty"` + ProxyConfig *ProxyConfig `json:"proxyConfig,omitempty"` + SSHTunnelConfig *SSHTunnelConfig `json:"sshConfig,omitempty"` +} + +type RegistryConfig struct { + RegistryId string + RegistryUrl string + RegistryUsername string + RegistryPassword string + RegistryConnectionType string //secure, insecure, secure-with-cert + RegistryCertificateString string + RegistryCAFilePath string + IsPublicRegistry bool + ConnectionMethod ConnectionMethod //ssh, proxy + ProxyConfig *ProxyConfig + SSHConfig *SSHTunnelConfig +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 55bfeb0206..b7169aaa9e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -377,7 +377,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.0.16-0.20240528043417-a3231e1245d8 +# github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba ## explicit; go 1.20 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/cloud-provider-identifier @@ -395,6 +395,7 @@ github.com/devtron-labs/common-lib/utils/k8s github.com/devtron-labs/common-lib/utils/k8s/commonBean github.com/devtron-labs/common-lib/utils/k8s/health github.com/devtron-labs/common-lib/utils/k8sObjectsUtil +github.com/devtron-labs/common-lib/utils/remoteConnection/bean github.com/devtron-labs/common-lib/utils/yaml # github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 ## explicit; go 1.17 From e731e9ff81d6497831b637d5569531e93beb3817 Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Tue, 28 May 2024 16:42:16 +0530 Subject: [PATCH 4/8] fix: update common lib and wire --- go.mod | 2 +- go.sum | 4 ++-- .../common-lib/pubsub-lib/JetStreamUtil.go | 2 +- .../common-lib/pubsub-lib/NatsClient.go | 7 +------ .../pubsub-lib/PubSubClientService.go | 19 ------------------- vendor/modules.txt | 2 +- wire_gen.go | 5 ++++- 7 files changed, 10 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 2de97c4f5c..5946848437 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 - github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba + github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 github.com/evanphx/json-patch v5.6.0+incompatible github.com/gammazero/workerpool v1.1.3 diff --git a/go.sum b/go.sum index 1aad577cc5..ad2f4c3d8a 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADG github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 h1:AUTYcDnL6w6Ux+264VldYaOUQAP6pDZ5Tq8wCKJyiEg= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470/go.mod h1:JQxTCMmQisrpjzETJr0tzVadV+wW23rHEZAY7JVyK3s= -github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba h1:ga3jPERHNyVg2u47NjOCZ9f7uYRtBtNT20AW2VMVT7k= -github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= +github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d h1:isvK4uvMYSkJWExrXn22nvXYOum7iygZ5Z887e5mx0g= +github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 h1:TElPRU69QedW7DIQiiQxtjwSQ6cK0fCTAMGvSLhP0ac= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534/go.mod h1:ypUknVph8Ph4dxSlrFoouf7wLedQxHku2LQwgRrdgS4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go index f780dde05c..c0363436ef 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go @@ -341,7 +341,7 @@ func AddStream(js nats.JetStreamContext, streamConfig *nats.StreamConfig, stream func checkConfigChangeReqd(existingConfig *nats.StreamConfig, toUpdateConfig *nats.StreamConfig) bool { configChanged := false newStreamSubjects := GetStreamSubjects(toUpdateConfig.Name) - if ((toUpdateConfig.MaxAge != time.Duration(0)) && (toUpdateConfig.MaxAge != existingConfig.MaxAge)) || (len(newStreamSubjects) != len(existingConfig.Subjects) || (toUpdateConfig.Replicas != existingConfig.Replicas)) { + if ((toUpdateConfig.MaxAge != time.Duration(0)) && (toUpdateConfig.MaxAge != existingConfig.MaxAge)) || (len(newStreamSubjects) != len(existingConfig.Subjects)) { existingConfig.MaxAge = toUpdateConfig.MaxAge existingConfig.Subjects = newStreamSubjects configChanged = true diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go index 05021e28ca..5ebedbeb2e 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go @@ -47,7 +47,6 @@ type NatsClientConfig struct { NatsMsgBufferSize int `env:"NATS_MSG_BUFFER_SIZE" envDefault:"-1"` NatsMsgMaxAge int `env:"NATS_MSG_MAX_AGE" envDefault:"86400"` NatsMsgAckWaitInSecs int `env:"NATS_MSG_ACK_WAIT_IN_SECS" envDefault:"120"` - Replicas int `env:"REPLICAS" envDefault:"0"` } func (ncc NatsClientConfig) GetNatsMsgBufferSize() int { @@ -63,7 +62,6 @@ func (ncc NatsClientConfig) GetDefaultNatsConsumerConfig() NatsConsumerConfig { NatsMsgProcessingBatchSize: ncc.NatsMsgProcessingBatchSize, NatsMsgBufferSize: ncc.GetNatsMsgBufferSize(), AckWaitInSecs: ncc.NatsMsgAckWaitInSecs, - Replicas: ncc.Replicas, } } @@ -76,8 +74,7 @@ func (ncc NatsClientConfig) GetDefaultNatsStreamConfig() NatsStreamConfig { } type StreamConfig struct { - MaxAge time.Duration `json:"max_age"` - Replicas int `json:"num_replicas"` + MaxAge time.Duration `json:"max_age"` } type NatsStreamConfig struct { @@ -92,8 +89,6 @@ type NatsConsumerConfig struct { NatsMsgBufferSize int `json:"natsMsgBufferSize"` // AckWaitInSecs is the time in seconds for which the message can be in unacknowledged state AckWaitInSecs int `json:"ackWaitInSecs"` - //it will show the instances created for the consumers on a particular subject(topic) - Replicas int `json:"replicas"` } func (consumerConf NatsConsumerConfig) GetNatsMsgBufferSize() int { diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go index f311d35b91..ab3a1fa488 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go @@ -27,7 +27,6 @@ type LoggerFunc func(msg model.PubSubMsg) (logMsg string, keysAndValues []interf type PubSubClientService interface { Publish(topic string, msg string) error Subscribe(topic string, callback func(msg *model.PubSubMsg), loggerFunc LoggerFunc, validations ...ValidateMsg) error - isClustered() } type PubSubClientServiceImpl struct { @@ -139,7 +138,6 @@ func (impl PubSubClientServiceImpl) Subscribe(topic string, callback func(msg *m } go impl.startListeningForEvents(processingBatchSize, channel, callback, loggerFunc, validations...) - //time.Sleep(10 * time.Second) impl.Logger.Infow("Successfully subscribed with Nats", "stream", streamName, "topic", topic, "queue", queueName, "consumer", consumerName) return nil } @@ -247,12 +245,6 @@ func (impl PubSubClientServiceImpl) TryCatchCallBack(msg *nats.Msg, callback fun callback(subMsg) } -func (impl PubSubClientServiceImpl) isClustered(streamName string) bool { - // This is only ever set, no need for lock here. - streamInfo, _ := impl.NatsClient.JetStrCtxt.StreamInfo(streamName) - return streamInfo.Cluster != nil -} - func (impl PubSubClientServiceImpl) getStreamConfig(streamName string) *nats.StreamConfig { configJson := NatsStreamWiseConfigMapping[streamName].StreamConfig streamCfg := &nats.StreamConfig{} @@ -293,17 +285,6 @@ func (impl PubSubClientServiceImpl) updateConsumer(natsClient *NatsClient, strea existingConfig.MaxAckPending = messageBufferSize updatesDetected = true } - if replicas := overrideConfig.Replicas; replicas > 0 && existingConfig.Replicas != replicas && replicas < 5 { - if replicas > 1 && impl.isClustered(streamName) { - existingConfig.Replicas = replicas - updatesDetected = true - } else { - if replicas > 1 { - impl.Logger.Errorw("replicas >1 is not possible in non-clustered mode ") - } - } - - } if updatesDetected { _, err = natsClient.JetStrCtxt.UpdateConsumer(streamName, &existingConfig) diff --git a/vendor/modules.txt b/vendor/modules.txt index b7169aaa9e..f535b90d7f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -377,7 +377,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.0.19-0.20240528102926-4f4883b450ba +# github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d ## explicit; go 1.20 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/cloud-provider-identifier diff --git a/wire_gen.go b/wire_gen.go index 370e4caa56..3d1bd5c4e1 100644 --- a/wire_gen.go +++ b/wire_gen.go @@ -368,7 +368,10 @@ func InitializeApp() (*App, error) { if err != nil { return nil, err } - pubSubClientServiceImpl := pubsub_lib.NewPubSubClientServiceImpl(sugaredLogger) + pubSubClientServiceImpl, err := pubsub_lib.NewPubSubClientServiceImpl(sugaredLogger) + if err != nil { + return nil, err + } ciPipelineRepositoryImpl := pipelineConfig.NewCiPipelineRepositoryImpl(db, sugaredLogger, transactionUtilImpl) moduleActionAuditLogRepositoryImpl := module.NewModuleActionAuditLogRepositoryImpl(db) serverCacheServiceImpl, err := server.NewServerCacheServiceImpl(sugaredLogger, serverEnvConfigServerEnvConfig, serverDataStoreServerDataStore, helmAppServiceImpl) From f03a78326696ee4c7a109d4ca972aedbe324925d Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Tue, 28 May 2024 16:56:49 +0530 Subject: [PATCH 5/8] fix : add argo cd assets --- .../argoproj/argo-cd/assets/badge.svg | 22 + .../argo-cd/assets/builtin-policy.csv | 34 + .../argoproj/argo-cd/assets/model.conf | 14 + .../argoproj/argo-cd/assets/swagger.json | 3887 +++++++++++++++++ 4 files changed, 3957 insertions(+) create mode 100644 vendor/github.com/argoproj/argo-cd/assets/badge.svg create mode 100644 vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv create mode 100644 vendor/github.com/argoproj/argo-cd/assets/model.conf create mode 100644 vendor/github.com/argoproj/argo-cd/assets/swagger.json diff --git a/vendor/github.com/argoproj/argo-cd/assets/badge.svg b/vendor/github.com/argoproj/argo-cd/assets/badge.svg new file mode 100644 index 0000000000..a3234cfdf5 --- /dev/null +++ b/vendor/github.com/argoproj/argo-cd/assets/badge.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv b/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv new file mode 100644 index 0000000000..f74c5b8002 --- /dev/null +++ b/vendor/github.com/argoproj/argo-cd/assets/builtin-policy.csv @@ -0,0 +1,34 @@ +# Built-in policy which defines two roles: role:readonly and role:admin, +# and additionally assigns the admin user to the role:admin role. +# There are two policy formats: +# 1. Applications (which belong to a project): +# p, , , , / +# 2. All other resources: +# p, , , , + +p, role:readonly, applications, get, */*, allow +p, role:readonly, certificates, get, *, allow +p, role:readonly, clusters, get, *, allow +p, role:readonly, repositories, get, *, allow +p, role:readonly, projects, get, *, allow + +p, role:admin, applications, create, */*, allow +p, role:admin, applications, update, */*, allow +p, role:admin, applications, delete, */*, allow +p, role:admin, applications, sync, */*, allow +p, role:admin, applications, override, */*, allow +p, role:admin, certificates, create, *, allow +p, role:admin, certificates, update, *, allow +p, role:admin, certificates, delete, *, allow +p, role:admin, clusters, create, *, allow +p, role:admin, clusters, update, *, allow +p, role:admin, clusters, delete, *, allow +p, role:admin, repositories, create, *, allow +p, role:admin, repositories, update, *, allow +p, role:admin, repositories, delete, *, allow +p, role:admin, projects, create, *, allow +p, role:admin, projects, update, *, allow +p, role:admin, projects, delete, *, allow + +g, role:admin, role:readonly +g, admin, role:admin \ No newline at end of file diff --git a/vendor/github.com/argoproj/argo-cd/assets/model.conf b/vendor/github.com/argoproj/argo-cd/assets/model.conf new file mode 100644 index 0000000000..240a9180d3 --- /dev/null +++ b/vendor/github.com/argoproj/argo-cd/assets/model.conf @@ -0,0 +1,14 @@ +[request_definition] +r = sub, res, act, obj + +[policy_definition] +p = sub, res, act, obj, eft + +[role_definition] +g = _, _ + +[policy_effect] +e = some(where (p.eft == allow)) && !some(where (p.eft == deny)) + +[matchers] +m = g(r.sub, p.sub) && keyMatch(r.res, p.res) && keyMatch(r.act, p.act) && keyMatch(r.obj, p.obj) \ No newline at end of file diff --git a/vendor/github.com/argoproj/argo-cd/assets/swagger.json b/vendor/github.com/argoproj/argo-cd/assets/swagger.json new file mode 100644 index 0000000000..0ad53c18de --- /dev/null +++ b/vendor/github.com/argoproj/argo-cd/assets/swagger.json @@ -0,0 +1,3887 @@ +{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "swagger": "2.0", + "info": { + "description": "Description of all APIs", + "title": "Consolidate Services", + "version": "version not set" + }, + "paths": { + "/api/v1/account/password": { + "put": { + "tags": [ + "AccountService" + ], + "summary": "UpdatePassword updates an account's password to a new value", + "operationId": "UpdatePassword", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/accountUpdatePasswordRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/accountUpdatePasswordResponse" + } + } + } + } + }, + "/api/v1/applications": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "List returns list of applications", + "operationId": "ListMixin6", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "query" + }, + { + "type": "string", + "name": "refresh", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "name": "project", + "in": "query" + }, + { + "type": "string", + "name": "resourceVersion", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1ApplicationList" + } + } + } + }, + "post": { + "tags": [ + "ApplicationService" + ], + "summary": "Create creates an application", + "operationId": "CreateMixin6", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + } + } + }, + "/api/v1/applications/{application.metadata.name}": { + "put": { + "tags": [ + "ApplicationService" + ], + "summary": "Update updates an application", + "operationId": "UpdateMixin6", + "parameters": [ + { + "type": "string", + "name": "application.metadata.name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + } + } + }, + "/api/v1/applications/{applicationName}/managed-resources": { + "get": { + "tags": [ + "ApplicationService" + ], + "operationId": "ManagedResources", + "parameters": [ + { + "type": "string", + "name": "applicationName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationManagedResourcesResponse" + } + } + } + } + }, + "/api/v1/applications/{applicationName}/resource-tree": { + "get": { + "tags": [ + "ApplicationService" + ], + "operationId": "ResourceTree", + "parameters": [ + { + "type": "string", + "name": "applicationName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1ApplicationTree" + } + } + } + } + }, + "/api/v1/applications/{name}": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "Get returns an application by name", + "operationId": "GetMixin6", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "refresh", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "name": "project", + "in": "query" + }, + { + "type": "string", + "name": "resourceVersion", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + } + }, + "delete": { + "tags": [ + "ApplicationService" + ], + "summary": "Delete deletes an application", + "operationId": "DeleteMixin6", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationApplicationResponse" + } + } + } + }, + "patch": { + "tags": [ + "ApplicationService" + ], + "summary": "Patch patch an application", + "operationId": "Patch", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/applicationApplicationPatchRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + } + } + }, + "/api/v1/applications/{name}/events": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "ListResourceEvents returns a list of event resources", + "operationId": "ListResourceEvents", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "resourceNamespace", + "in": "query" + }, + { + "type": "string", + "name": "resourceName", + "in": "query" + }, + { + "type": "string", + "name": "resourceUID", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1EventList" + } + } + } + } + }, + "/api/v1/applications/{name}/manifests": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "GetManifests returns application manifests", + "operationId": "GetManifests", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "revision", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/repositoryManifestResponse" + } + } + } + } + }, + "/api/v1/applications/{name}/operation": { + "delete": { + "tags": [ + "ApplicationService" + ], + "summary": "TerminateOperation terminates the currently running operation", + "operationId": "TerminateOperation", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationOperationTerminateResponse" + } + } + } + } + }, + "/api/v1/applications/{name}/pods/{podName}/logs": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "PodLogs returns stream of log entries for the specified pod. Pod", + "operationId": "PodLogs", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "podName", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "namespace", + "in": "query" + }, + { + "type": "string", + "name": "container", + "in": "query" + }, + { + "type": "string", + "format": "int64", + "name": "sinceSeconds", + "in": "query" + }, + { + "type": "string", + "format": "int64", + "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.", + "name": "sinceTime.seconds", + "in": "query" + }, + { + "type": "integer", + "format": "int32", + "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive. This field may be limited in precision depending on context.", + "name": "sinceTime.nanos", + "in": "query" + }, + { + "type": "string", + "format": "int64", + "name": "tailLines", + "in": "query" + }, + { + "type": "boolean", + "format": "boolean", + "name": "follow", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/applicationLogEntry" + } + } + } + } + }, + "/api/v1/applications/{name}/resource": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "GetResource returns single application resource", + "operationId": "GetResource", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "namespace", + "in": "query" + }, + { + "type": "string", + "name": "resourceName", + "in": "query" + }, + { + "type": "string", + "name": "version", + "in": "query" + }, + { + "type": "string", + "name": "group", + "in": "query" + }, + { + "type": "string", + "name": "kind", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationApplicationResourceResponse" + } + } + } + }, + "post": { + "tags": [ + "ApplicationService" + ], + "summary": "PatchResource patch single application resource", + "operationId": "PatchResource", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationApplicationResourceResponse" + } + } + } + }, + "delete": { + "tags": [ + "ApplicationService" + ], + "summary": "DeleteResource deletes a single application resource", + "operationId": "DeleteResource", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationApplicationResponse" + } + } + } + } + }, + "/api/v1/applications/{name}/resource/actions": { + "get": { + "tags": [ + "ApplicationService" + ], + "operationId": "ListResourceActions", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "namespace", + "in": "query" + }, + { + "type": "string", + "name": "resourceName", + "in": "query" + }, + { + "type": "string", + "name": "version", + "in": "query" + }, + { + "type": "string", + "name": "group", + "in": "query" + }, + { + "type": "string", + "name": "kind", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationResourceActionsListResponse" + } + } + } + }, + "post": { + "tags": [ + "ApplicationService" + ], + "operationId": "RunResourceAction", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/applicationApplicationResponse" + } + } + } + } + }, + "/api/v1/applications/{name}/revisions/{revision}/metadata": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "Get the meta-data (author, date, tags, message) for a specific revision of the application", + "operationId": "RevisionMetadata", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "revision", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1RevisionMetadata" + } + } + } + } + }, + "/api/v1/applications/{name}/rollback": { + "post": { + "tags": [ + "ApplicationService" + ], + "summary": "Rollback syncs an application to its target state", + "operationId": "Rollback", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/applicationApplicationRollbackRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + } + } + }, + "/api/v1/applications/{name}/spec": { + "put": { + "tags": [ + "ApplicationService" + ], + "summary": "UpdateSpec updates an application spec", + "operationId": "UpdateSpec", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1ApplicationSpec" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1ApplicationSpec" + } + } + } + } + }, + "/api/v1/applications/{name}/sync": { + "post": { + "tags": [ + "ApplicationService" + ], + "summary": "Sync syncs an application to its target state", + "operationId": "Sync", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/applicationApplicationSyncRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Application" + } + } + } + } + }, + "/api/v1/certificates": { + "get": { + "tags": [ + "CertificateService" + ], + "summary": "List all available repository certificates", + "operationId": "ListCertificates", + "parameters": [ + { + "type": "string", + "description": "A file-glob pattern (not regular expression) the host name has to match.", + "name": "hostNamePattern", + "in": "query" + }, + { + "type": "string", + "description": "The type of the certificate to match (ssh or https).", + "name": "certType", + "in": "query" + }, + { + "type": "string", + "description": "The sub type of the certificate to match (protocol dependent, usually only used for ssh certs).", + "name": "certSubType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1RepositoryCertificateList" + } + } + } + }, + "post": { + "tags": [ + "CertificateService" + ], + "summary": "Creates repository certificates on the server", + "operationId": "CreateCertificate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1RepositoryCertificateList" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1RepositoryCertificateList" + } + } + } + }, + "delete": { + "tags": [ + "CertificateService" + ], + "summary": "Delete the certificates that match the RepositoryCertificateQuery", + "operationId": "DeleteCertificate", + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1RepositoryCertificateList" + } + } + } + } + }, + "/api/v1/clusters": { + "get": { + "tags": [ + "ClusterService" + ], + "summary": "List returns list of clusters", + "operationId": "List", + "parameters": [ + { + "type": "string", + "name": "server", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1ClusterList" + } + } + } + }, + "post": { + "tags": [ + "ClusterService" + ], + "summary": "Create creates a cluster", + "operationId": "Create", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1Cluster" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Cluster" + } + } + } + } + }, + "/api/v1/clusters/{cluster.server}": { + "put": { + "tags": [ + "ClusterService" + ], + "summary": "Update updates a cluster", + "operationId": "Update", + "parameters": [ + { + "type": "string", + "name": "cluster.server", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1Cluster" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Cluster" + } + } + } + } + }, + "/api/v1/clusters/{server}": { + "get": { + "tags": [ + "ClusterService" + ], + "summary": "Get returns a cluster by server address", + "operationId": "GetMixin1", + "parameters": [ + { + "type": "string", + "name": "server", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Cluster" + } + } + } + }, + "delete": { + "tags": [ + "ClusterService" + ], + "summary": "Delete deletes a cluster", + "operationId": "Delete", + "parameters": [ + { + "type": "string", + "name": "server", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/clusterClusterResponse" + } + } + } + } + }, + "/api/v1/clusters/{server}/rotate-auth": { + "post": { + "tags": [ + "ClusterService" + ], + "summary": "RotateAuth returns a cluster by server address", + "operationId": "RotateAuth", + "parameters": [ + { + "type": "string", + "name": "server", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/clusterClusterResponse" + } + } + } + } + }, + "/api/v1/projects": { + "get": { + "tags": [ + "ProjectService" + ], + "summary": "List returns list of projects", + "operationId": "ListMixin4", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1AppProjectList" + } + } + } + }, + "post": { + "tags": [ + "ProjectService" + ], + "summary": "Create a new project.", + "operationId": "CreateMixin4", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/projectProjectCreateRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1AppProject" + } + } + } + } + }, + "/api/v1/projects/{name}": { + "get": { + "tags": [ + "ProjectService" + ], + "summary": "Get returns a project by name", + "operationId": "GetMixin4", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1AppProject" + } + } + } + }, + "delete": { + "tags": [ + "ProjectService" + ], + "summary": "Delete deletes a project", + "operationId": "DeleteMixin4", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/projectEmptyResponse" + } + } + } + } + }, + "/api/v1/projects/{name}/events": { + "get": { + "tags": [ + "ProjectService" + ], + "summary": "ListEvents returns a list of project events", + "operationId": "ListEvents", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1EventList" + } + } + } + } + }, + "/api/v1/projects/{project.metadata.name}": { + "put": { + "tags": [ + "ProjectService" + ], + "summary": "Update updates a project", + "operationId": "UpdateMixin4", + "parameters": [ + { + "type": "string", + "name": "project.metadata.name", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/projectProjectUpdateRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1AppProject" + } + } + } + } + }, + "/api/v1/projects/{project}/roles/{role}/token": { + "post": { + "tags": [ + "ProjectService" + ], + "summary": "Create a new project token.", + "operationId": "CreateToken", + "parameters": [ + { + "type": "string", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "role", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/projectProjectTokenCreateRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/projectProjectTokenResponse" + } + } + } + } + }, + "/api/v1/projects/{project}/roles/{role}/token/{iat}": { + "delete": { + "tags": [ + "ProjectService" + ], + "summary": "Delete a new project token.", + "operationId": "DeleteToken", + "parameters": [ + { + "type": "string", + "name": "project", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "role", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "int64", + "name": "iat", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/projectEmptyResponse" + } + } + } + } + }, + "/api/v1/repositories": { + "get": { + "tags": [ + "RepositoryService" + ], + "summary": "List returns list of repos", + "operationId": "ListMixin2", + "parameters": [ + { + "type": "string", + "name": "repo", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1RepositoryList" + } + } + } + }, + "post": { + "tags": [ + "RepositoryService" + ], + "summary": "Create creates a repo", + "operationId": "CreateMixin2", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1Repository" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Repository" + } + } + } + } + }, + "/api/v1/repositories/{repo.repo}": { + "put": { + "tags": [ + "RepositoryService" + ], + "summary": "Update updates a repo", + "operationId": "UpdateMixin2", + "parameters": [ + { + "type": "string", + "name": "repo.repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1alpha1Repository" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/v1alpha1Repository" + } + } + } + } + }, + "/api/v1/repositories/{repo}": { + "delete": { + "tags": [ + "RepositoryService" + ], + "summary": "Delete deletes a repo", + "operationId": "DeleteMixin2", + "parameters": [ + { + "type": "string", + "name": "repo", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/repositoryRepoResponse" + } + } + } + } + }, + "/api/v1/repositories/{repo}/apps": { + "get": { + "tags": [ + "RepositoryService" + ], + "summary": "ListApps returns list of apps in the repo", + "operationId": "ListApps", + "parameters": [ + { + "type": "string", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "revision", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/repositoryRepoAppsResponse" + } + } + } + } + }, + "/api/v1/repositories/{repo}/apps/{path}": { + "get": { + "tags": [ + "RepositoryService" + ], + "summary": "GetAppDetails returns application details by given path", + "operationId": "GetAppDetails", + "parameters": [ + { + "type": "string", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "path", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "revision", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "name": "helm.valueFiles", + "in": "query" + }, + { + "type": "string", + "name": "ksonnet.environment", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/repositoryRepoAppDetailsResponse" + } + } + } + } + }, + "/api/v1/repositories/{repo}/validate": { + "post": { + "tags": [ + "RepositoryService" + ], + "summary": "ValidateAccess validates access to a repository with given parameters", + "operationId": "ValidateAccess", + "parameters": [ + { + "type": "string", + "name": "repo", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/repositoryRepoResponse" + } + } + } + } + }, + "/api/v1/session": { + "post": { + "tags": [ + "SessionService" + ], + "summary": "Create a new JWT for authentication and set a cookie if using HTTP.", + "operationId": "CreateMixin8", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/sessionSessionCreateRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/sessionSessionResponse" + } + } + } + }, + "delete": { + "tags": [ + "SessionService" + ], + "summary": "Delete an existing JWT cookie if using HTTP.", + "operationId": "DeleteMixin8", + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/sessionSessionResponse" + } + } + } + } + }, + "/api/v1/settings": { + "get": { + "tags": [ + "SettingsService" + ], + "summary": "Get returns Argo CD settings", + "operationId": "Get", + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/clusterSettings" + } + } + } + } + }, + "/api/v1/stream/applications": { + "get": { + "tags": [ + "ApplicationService" + ], + "summary": "Watch returns stream of application change events.", + "operationId": "Watch", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "query" + }, + { + "type": "string", + "name": "refresh", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "name": "project", + "in": "query" + }, + { + "type": "string", + "name": "resourceVersion", + "in": "query" + } + ], + "responses": { + "200": { + "description": "(streaming responses)", + "schema": { + "$ref": "#/definitions/v1alpha1ApplicationWatchEvent" + } + } + } + } + }, + "/api/version": { + "get": { + "tags": [ + "VersionService" + ], + "summary": "Version returns version information of the API server", + "operationId": "Version", + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/versionVersionMessage" + } + } + } + } + } + }, + "definitions": { + "accountUpdatePasswordRequest": { + "type": "object", + "properties": { + "currentPassword": { + "type": "string" + }, + "newPassword": { + "type": "string" + } + } + }, + "accountUpdatePasswordResponse": { + "type": "object" + }, + "applicationApplicationPatchRequest": { + "type": "object", + "title": "ApplicationPatchRequest is a request to patch an application", + "properties": { + "name": { + "type": "string" + }, + "patch": { + "type": "string" + }, + "patchType": { + "type": "string" + } + } + }, + "applicationApplicationResourceResponse": { + "type": "object", + "properties": { + "manifest": { + "type": "string" + } + } + }, + "applicationApplicationResponse": { + "type": "object" + }, + "applicationApplicationRollbackRequest": { + "type": "object", + "properties": { + "dryRun": { + "type": "boolean", + "format": "boolean" + }, + "id": { + "type": "string", + "format": "int64" + }, + "name": { + "type": "string" + }, + "prune": { + "type": "boolean", + "format": "boolean" + } + } + }, + "applicationApplicationSyncRequest": { + "type": "object", + "title": "ApplicationSyncRequest is a request to apply the config state to live state", + "properties": { + "dryRun": { + "type": "boolean", + "format": "boolean" + }, + "manifests": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "prune": { + "type": "boolean", + "format": "boolean" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1SyncOperationResource" + } + }, + "revision": { + "type": "string" + }, + "strategy": { + "$ref": "#/definitions/v1alpha1SyncStrategy" + } + } + }, + "applicationLogEntry": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "timeStamp": { + "$ref": "#/definitions/v1Time" + } + } + }, + "applicationManagedResourcesResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceDiff" + } + } + } + }, + "applicationOperationTerminateResponse": { + "type": "object" + }, + "applicationResourceActionsListResponse": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceAction" + } + } + } + }, + "clusterClusterResponse": { + "type": "object" + }, + "clusterConnector": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "clusterDexConfig": { + "type": "object", + "properties": { + "connectors": { + "type": "array", + "items": { + "$ref": "#/definitions/clusterConnector" + } + } + } + }, + "clusterGoogleAnalyticsConfig": { + "type": "object", + "properties": { + "anonymizeUsers": { + "type": "boolean", + "format": "boolean" + }, + "trackingID": { + "type": "string" + } + } + }, + "clusterHelp": { + "type": "object", + "title": "Help settings", + "properties": { + "chatText": { + "type": "string", + "title": "the text for getting chat help, defaults to \"Chat now!\"" + }, + "chatUrl": { + "type": "string", + "title": "the URL for getting chat help, this will typically be your Slack channel for support" + } + } + }, + "clusterOIDCConfig": { + "type": "object", + "properties": { + "cliClientID": { + "type": "string" + }, + "clientID": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "name": { + "type": "string" + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "clusterSettings": { + "type": "object", + "properties": { + "appLabelKey": { + "type": "string" + }, + "dexConfig": { + "$ref": "#/definitions/clusterDexConfig" + }, + "googleAnalytics": { + "$ref": "#/definitions/clusterGoogleAnalyticsConfig" + }, + "help": { + "$ref": "#/definitions/clusterHelp" + }, + "kustomizeOptions": { + "$ref": "#/definitions/v1alpha1KustomizeOptions" + }, + "oidcConfig": { + "$ref": "#/definitions/clusterOIDCConfig" + }, + "resourceOverrides": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1alpha1ResourceOverride" + } + }, + "statusBadgeEnabled": { + "type": "boolean", + "format": "boolean" + }, + "url": { + "type": "string" + } + } + }, + "projectEmptyResponse": { + "type": "object" + }, + "projectProjectCreateRequest": { + "description": "ProjectCreateRequest defines project creation parameters.", + "type": "object", + "properties": { + "project": { + "$ref": "#/definitions/v1alpha1AppProject" + } + } + }, + "projectProjectTokenCreateRequest": { + "description": "ProjectTokenCreateRequest defines project token creation parameters.", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "expiresIn": { + "type": "string", + "format": "int64", + "title": "expiresIn represents a duration in seconds" + }, + "project": { + "type": "string" + }, + "role": { + "type": "string" + } + } + }, + "projectProjectTokenResponse": { + "description": "ProjectTokenResponse wraps the created token or returns an empty string if deleted.", + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "projectProjectUpdateRequest": { + "type": "object", + "properties": { + "project": { + "$ref": "#/definitions/v1alpha1AppProject" + } + } + }, + "repositoryAppInfo": { + "type": "object", + "title": "AppInfo contains application type and app file path", + "properties": { + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "repositoryDirectoryAppSpec": { + "type": "object", + "title": "DirectoryAppSpec contains directory" + }, + "repositoryHelmAppDetailsQuery": { + "type": "object", + "properties": { + "valueFiles": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "repositoryHelmAppSpec": { + "type": "object", + "title": "HelmAppSpec contains helm app name and path in source repo", + "properties": { + "name": { + "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1HelmParameter" + } + }, + "path": { + "type": "string" + }, + "valueFiles": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "repositoryKsonnetAppDetailsQuery": { + "type": "object", + "properties": { + "environment": { + "type": "string" + } + } + }, + "repositoryKsonnetAppSpec": { + "type": "object", + "title": "KsonnetAppSpec contains Ksonnet app response\nThis roughly reflects: ksonnet/ksonnet/metadata/app/schema.go", + "properties": { + "environments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/repositoryKsonnetEnvironment" + } + }, + "name": { + "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1KsonnetParameter" + } + }, + "path": { + "type": "string" + } + } + }, + "repositoryKsonnetEnvironment": { + "type": "object", + "properties": { + "destination": { + "$ref": "#/definitions/repositoryKsonnetEnvironmentDestination" + }, + "k8sVersion": { + "description": "KubernetesVersion is the kubernetes version the targetted cluster is running on.", + "type": "string" + }, + "name": { + "type": "string", + "title": "Name is the user defined name of an environment" + }, + "path": { + "description": "Path is the relative project path containing metadata for this environment.", + "type": "string" + } + } + }, + "repositoryKsonnetEnvironmentDestination": { + "type": "object", + "properties": { + "namespace": { + "type": "string", + "title": "Namespace is the namespace of the Kubernetes server that targets should be deployed to" + }, + "server": { + "description": "Server is the Kubernetes server that the cluster is running on.", + "type": "string" + } + } + }, + "repositoryKustomizeAppSpec": { + "type": "object", + "title": "KustomizeAppSpec contains kustomize app name and path in source repo", + "properties": { + "images": { + "description": "images is a list of available images.", + "type": "array", + "items": { + "type": "string" + } + }, + "path": { + "type": "string" + } + } + }, + "repositoryManifestResponse": { + "type": "object", + "properties": { + "manifests": { + "type": "array", + "items": { + "type": "string" + } + }, + "namespace": { + "type": "string" + }, + "revision": { + "type": "string" + }, + "server": { + "type": "string" + }, + "sourceType": { + "type": "string" + } + } + }, + "repositoryRepoAppDetailsResponse": { + "type": "object", + "title": "RepoAppDetailsResponse application details", + "properties": { + "directory": { + "$ref": "#/definitions/repositoryDirectoryAppSpec" + }, + "helm": { + "$ref": "#/definitions/repositoryHelmAppSpec" + }, + "ksonnet": { + "$ref": "#/definitions/repositoryKsonnetAppSpec" + }, + "kustomize": { + "$ref": "#/definitions/repositoryKustomizeAppSpec" + }, + "type": { + "type": "string" + } + } + }, + "repositoryRepoAppsResponse": { + "type": "object", + "title": "RepoAppsResponse contains applications of specified repository", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/repositoryAppInfo" + } + } + } + }, + "repositoryRepoResponse": { + "type": "object" + }, + "sessionSessionCreateRequest": { + "description": "SessionCreateRequest is for logging in.", + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "token": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "sessionSessionResponse": { + "description": "SessionResponse wraps the created token or returns an empty string if deleted.", + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "v1Event": { + "description": "Event is a report of an event somewhere in the cluster.", + "type": "object", + "properties": { + "action": { + "type": "string", + "title": "What action was taken/failed regarding to the Regarding object.\n+optional" + }, + "count": { + "type": "integer", + "format": "int32", + "title": "The number of times this event has occurred.\n+optional" + }, + "eventTime": { + "$ref": "#/definitions/v1MicroTime" + }, + "firstTimestamp": { + "$ref": "#/definitions/v1Time" + }, + "involvedObject": { + "$ref": "#/definitions/v1ObjectReference" + }, + "lastTimestamp": { + "$ref": "#/definitions/v1Time" + }, + "message": { + "type": "string", + "title": "A human-readable description of the status of this operation.\nTODO: decide on maximum length.\n+optional" + }, + "metadata": { + "$ref": "#/definitions/v1ObjectMeta" + }, + "reason": { + "type": "string", + "title": "This should be a short, machine understandable string that gives the reason\nfor the transition into the object's current status.\nTODO: provide exact specification for format.\n+optional" + }, + "related": { + "$ref": "#/definitions/v1ObjectReference" + }, + "reportingComponent": { + "type": "string", + "title": "Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.\n+optional" + }, + "reportingInstance": { + "type": "string", + "title": "ID of the controller instance, e.g. `kubelet-xyzf`.\n+optional" + }, + "series": { + "$ref": "#/definitions/v1EventSeries" + }, + "source": { + "$ref": "#/definitions/v1EventSource" + }, + "type": { + "type": "string", + "title": "Type of this event (Normal, Warning), new types could be added in the future\n+optional" + } + } + }, + "v1EventList": { + "description": "EventList is a list of events.", + "type": "object", + "properties": { + "items": { + "type": "array", + "title": "List of events", + "items": { + "$ref": "#/definitions/v1Event" + } + }, + "metadata": { + "$ref": "#/definitions/v1ListMeta" + } + } + }, + "v1EventSeries": { + "description": "EventSeries contain information on series of events, i.e. thing that was/is happening\ncontinuously for some time.", + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int32", + "title": "Number of occurrences in this series up to the last heartbeat time" + }, + "lastObservedTime": { + "$ref": "#/definitions/v1MicroTime" + }, + "state": { + "type": "string", + "title": "State of this Series: Ongoing or Finished" + } + } + }, + "v1EventSource": { + "description": "EventSource contains information for an event.", + "type": "object", + "properties": { + "component": { + "type": "string", + "title": "Component from which the event is generated.\n+optional" + }, + "host": { + "type": "string", + "title": "Node name on which the event is generated.\n+optional" + } + } + }, + "v1Fields": { + "type": "object", + "title": "Fields stores a set of fields in a data structure like a Trie.\nTo understand how this is used, see: https://github.com/kubernetes-sigs/structured-merge-diff", + "properties": { + "map": { + "description": "Map stores a set of fields in a data structure like a Trie.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set,\nor a string representing a sub-field or item. The string will follow one of these four formats:\n'f:', where is the name of a field in a struct, or key in a map\n'v:', where is the exact json formatted value of a list item\n'i:', where is position of a item in a list\n'k:', where is a map of a list item's key fields to their unique values\nIf a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v1Fields" + } + } + } + }, + "v1GroupKind": { + "description": "+protobuf.options.(gogoproto.goproto_stringer)=false", + "type": "object", + "title": "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying\nconcepts during lookup stages without having partially valid types", + "properties": { + "group": { + "type": "string" + }, + "kind": { + "type": "string" + } + } + }, + "v1Initializer": { + "description": "Initializer is information about an initializer that has not yet completed.", + "type": "object", + "properties": { + "name": { + "description": "name of the process that is responsible for initializing this object.", + "type": "string" + } + } + }, + "v1Initializers": { + "description": "Initializers tracks the progress of initialization.", + "type": "object", + "properties": { + "pending": { + "type": "array", + "title": "Pending is a list of initializers that must execute in order before this object is visible.\nWhen the last pending initializer is removed, and no failing result is set, the initializers\nstruct will be set to nil and the object is considered as initialized and visible to all\nclients.\n+patchMergeKey=name\n+patchStrategy=merge", + "items": { + "$ref": "#/definitions/v1Initializer" + } + }, + "result": { + "$ref": "#/definitions/v1Status" + } + } + }, + "v1ListMeta": { + "description": "ListMeta describes metadata that synthetic resources must have, including lists and\nvarious status objects. A resource may have only one of {ObjectMeta, ListMeta}.", + "type": "object", + "properties": { + "continue": { + "description": "continue may be set if the user set a limit on the number of items returned, and indicates that\nthe server has more data available. The value is opaque and may be used to issue another request\nto the endpoint that served this list to retrieve the next set of available objects. Continuing a\nconsistent list may not be possible if the server configuration has changed or more than a few\nminutes have passed. The resourceVersion field returned when using this continue value will be\nidentical to the value in the first response, unless you have received this token from an error\nmessage.", + "type": "string" + }, + "resourceVersion": { + "type": "string", + "title": "String that identifies the server's internal version of this object that\ncan be used by clients to determine when objects have changed.\nValue must be treated as opaque by clients and passed unmodified back to the server.\nPopulated by the system.\nRead-only.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency\n+optional" + }, + "selfLink": { + "type": "string", + "title": "selfLink is a URL representing this object.\nPopulated by the system.\nRead-only.\n+optional" + } + } + }, + "v1LoadBalancerIngress": { + "description": "LoadBalancerIngress represents the status of a load-balancer ingress point:\ntraffic intended for the service should be sent to an ingress point.", + "type": "object", + "properties": { + "hostname": { + "type": "string", + "title": "Hostname is set for load-balancer ingress points that are DNS based\n(typically AWS load-balancers)\n+optional" + }, + "ip": { + "type": "string", + "title": "IP is set for load-balancer ingress points that are IP based\n(typically GCE or OpenStack load-balancers)\n+optional" + } + } + }, + "v1ManagedFieldsEntry": { + "description": "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource\nthat the fieldset applies to.", + "type": "object", + "properties": { + "apiVersion": { + "description": "APIVersion defines the version of this resource that this field set\napplies to. The format is \"group/version\" just like the top-level\nAPIVersion field. It is necessary to track the version of a field\nset because it cannot be automatically converted.", + "type": "string" + }, + "fields": { + "$ref": "#/definitions/v1Fields" + }, + "manager": { + "description": "Manager is an identifier of the workflow managing these fields.", + "type": "string" + }, + "operation": { + "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created.\nThe only valid values for this field are 'Apply' and 'Update'.", + "type": "string" + }, + "time": { + "$ref": "#/definitions/v1Time" + } + } + }, + "v1MicroTime": { + "description": "MicroTime is version of Time with microsecond level precision.\n\n+protobuf.options.marshal=false\n+protobuf.as=Timestamp\n+protobuf.options.(gogoproto.goproto_stringer)=false", + "type": "object", + "properties": { + "nanos": { + "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive. This field may be limited in precision depending on context.", + "type": "integer", + "format": "int32" + }, + "seconds": { + "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.", + "type": "string", + "format": "int64" + } + } + }, + "v1ObjectMeta": { + "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects\nusers must create.", + "type": "object", + "properties": { + "annotations": { + "type": "object", + "title": "Annotations is an unstructured key value map stored with a resource that may be\nset by external tools to store and retrieve arbitrary metadata. They are not\nqueryable and should be preserved when modifying objects.\nMore info: http://kubernetes.io/docs/user-guide/annotations\n+optional", + "additionalProperties": { + "type": "string" + } + }, + "clusterName": { + "type": "string", + "title": "The name of the cluster which the object belongs to.\nThis is used to distinguish resources with same name and namespace in different clusters.\nThis field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.\n+optional" + }, + "creationTimestamp": { + "$ref": "#/definitions/v1Time" + }, + "deletionGracePeriodSeconds": { + "type": "string", + "format": "int64", + "title": "Number of seconds allowed for this object to gracefully terminate before\nit will be removed from the system. Only set when deletionTimestamp is also set.\nMay only be shortened.\nRead-only.\n+optional" + }, + "deletionTimestamp": { + "$ref": "#/definitions/v1Time" + }, + "finalizers": { + "type": "array", + "title": "Must be empty before the object is deleted from the registry. Each entry\nis an identifier for the responsible component that will remove the entry\nfrom the list. If the deletionTimestamp of the object is non-nil, entries\nin this list can only be removed.\n+optional\n+patchStrategy=merge", + "items": { + "type": "string" + } + }, + "generateName": { + "description": "GenerateName is an optional prefix, used by the server, to generate a unique\nname ONLY IF the Name field has not been provided.\nIf this field is used, the name returned to the client will be different\nthan the name passed. This value will also be combined with a unique suffix.\nThe provided value has the same validation rules as the Name field,\nand may be truncated by the length of the suffix required to make the value\nunique on the server.\n\nIf this field is specified and the generated name exists, the server will\nNOT return a 409 - instead, it will either return 201 Created or 500 with Reason\nServerTimeout indicating a unique name could not be found in the time allotted, and the client\nshould retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency\n+optional", + "type": "string" + }, + "generation": { + "type": "string", + "format": "int64", + "title": "A sequence number representing a specific generation of the desired state.\nPopulated by the system. Read-only.\n+optional" + }, + "initializers": { + "$ref": "#/definitions/v1Initializers" + }, + "labels": { + "type": "object", + "title": "Map of string keys and values that can be used to organize and categorize\n(scope and select) objects. May match selectors of replication controllers\nand services.\nMore info: http://kubernetes.io/docs/user-guide/labels\n+optional", + "additionalProperties": { + "type": "string" + } + }, + "managedFields": { + "description": "ManagedFields maps workflow-id and version to the set of fields\nthat are managed by that workflow. This is mostly for internal\nhousekeeping, and users typically shouldn't need to set or\nunderstand this field. A workflow can be the user's name, a\ncontroller's name, or the name of a specific apply path like\n\"ci-cd\". The set of fields is always in the version that the\nworkflow used when modifying the object.\n\nThis field is alpha and can be changed or removed without notice.\n\n+optional", + "type": "array", + "items": { + "$ref": "#/definitions/v1ManagedFieldsEntry" + } + }, + "name": { + "type": "string", + "title": "Name must be unique within a namespace. Is required when creating resources, although\nsome resources may allow a client to request the generation of an appropriate name\nautomatically. Name is primarily intended for creation idempotence and configuration\ndefinition.\nCannot be updated.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#names\n+optional" + }, + "namespace": { + "description": "Namespace defines the space within each name must be unique. An empty namespace is\nequivalent to the \"default\" namespace, but \"default\" is the canonical representation.\nNot all objects are required to be scoped to a namespace - the value of this field for\nthose objects will be empty.\n\nMust be a DNS_LABEL.\nCannot be updated.\nMore info: http://kubernetes.io/docs/user-guide/namespaces\n+optional", + "type": "string" + }, + "ownerReferences": { + "type": "array", + "title": "List of objects depended by this object. If ALL objects in the list have\nbeen deleted, this object will be garbage collected. If this object is managed by a controller,\nthen an entry in this list will point to this controller, with the controller field set to true.\nThere cannot be more than one managing controller.\n+optional\n+patchMergeKey=uid\n+patchStrategy=merge", + "items": { + "$ref": "#/definitions/v1OwnerReference" + } + }, + "resourceVersion": { + "description": "An opaque value that represents the internal version of this object that can\nbe used by clients to determine when objects have changed. May be used for optimistic\nconcurrency, change detection, and the watch operation on a resource or set of resources.\nClients must treat these values as opaque and passed unmodified back to the server.\nThey may only be valid for a particular resource or set of resources.\n\nPopulated by the system.\nRead-only.\nValue must be treated as opaque by clients and .\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency\n+optional", + "type": "string" + }, + "selfLink": { + "type": "string", + "title": "SelfLink is a URL representing this object.\nPopulated by the system.\nRead-only.\n+optional" + }, + "uid": { + "description": "UID is the unique in time and space value for this object. It is typically generated by\nthe server on successful creation of a resource and is not allowed to change on PUT\noperations.\n\nPopulated by the system.\nRead-only.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#uids\n+optional", + "type": "string" + } + } + }, + "v1ObjectReference": { + "type": "object", + "title": "ObjectReference contains enough information to let you inspect or modify the referred object.\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", + "properties": { + "apiVersion": { + "type": "string", + "title": "API version of the referent.\n+optional" + }, + "fieldPath": { + "type": "string", + "title": "If referring to a piece of an object instead of an entire object, this string\nshould contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].\nFor example, if the object reference is to a container within a pod, this would take on a value like:\n\"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered\nthe event) or if no container name is specified \"spec.containers[2]\" (container with\nindex 2 in this pod). This syntax is chosen only to have some well-defined way of\nreferencing a part of an object.\nTODO: this design is not final and this field is subject to change in the future.\n+optional" + }, + "kind": { + "type": "string", + "title": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds\n+optional" + }, + "name": { + "type": "string", + "title": "Name of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names\n+optional" + }, + "namespace": { + "type": "string", + "title": "Namespace of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/\n+optional" + }, + "resourceVersion": { + "type": "string", + "title": "Specific resourceVersion to which this reference is made, if any.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency\n+optional" + }, + "uid": { + "type": "string", + "title": "UID of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids\n+optional" + } + } + }, + "v1OwnerReference": { + "description": "OwnerReference contains enough information to let you identify an owning\nobject. An owning object must be in the same namespace as the dependent, or\nbe cluster-scoped, so there is no namespace field.", + "type": "object", + "properties": { + "apiVersion": { + "description": "API version of the referent.", + "type": "string" + }, + "blockOwnerDeletion": { + "type": "boolean", + "format": "boolean", + "title": "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then\nthe owner cannot be deleted from the key-value store until this\nreference is removed.\nDefaults to false.\nTo set this field, a user needs \"delete\" permission of the owner,\notherwise 422 (Unprocessable Entity) will be returned.\n+optional" + }, + "controller": { + "type": "boolean", + "format": "boolean", + "title": "If true, this reference points to the managing controller.\n+optional" + }, + "kind": { + "type": "string", + "title": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds" + }, + "name": { + "type": "string", + "title": "Name of the referent.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#names" + }, + "uid": { + "type": "string", + "title": "UID of the referent.\nMore info: http://kubernetes.io/docs/user-guide/identifiers#uids" + } + } + }, + "v1Status": { + "description": "Status is a return value for calls that don't return other objects.", + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "title": "Suggested HTTP return code for this status, 0 if not set.\n+optional" + }, + "details": { + "$ref": "#/definitions/v1StatusDetails" + }, + "message": { + "type": "string", + "title": "A human-readable description of the status of this operation.\n+optional" + }, + "metadata": { + "$ref": "#/definitions/v1ListMeta" + }, + "reason": { + "type": "string", + "title": "A machine-readable description of why this operation is in the\n\"Failure\" status. If this value is empty there\nis no information available. A Reason clarifies an HTTP status\ncode but does not override it.\n+optional" + }, + "status": { + "type": "string", + "title": "Status of the operation.\nOne of: \"Success\" or \"Failure\".\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status\n+optional" + } + } + }, + "v1StatusCause": { + "description": "StatusCause provides more information about an api.Status failure, including\ncases when multiple errors are encountered.", + "type": "object", + "properties": { + "field": { + "description": "The field of the resource that has caused this error, as named by its JSON\nserialization. May include dot and postfix notation for nested attributes.\nArrays are zero-indexed. Fields may appear more than once in an array of\ncauses due to fields having multiple errors.\nOptional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"\n+optional", + "type": "string" + }, + "message": { + "type": "string", + "title": "A human-readable description of the cause of the error. This field may be\npresented as-is to a reader.\n+optional" + }, + "reason": { + "type": "string", + "title": "A machine-readable description of the cause of the error. If this value is\nempty there is no information available.\n+optional" + } + } + }, + "v1StatusDetails": { + "description": "StatusDetails is a set of additional properties that MAY be set by the\nserver to provide additional information about a response. The Reason\nfield of a Status object defines what attributes will be set. Clients\nmust ignore fields that do not match the defined type of each attribute,\nand should assume that any attribute may be empty, invalid, or under\ndefined.", + "type": "object", + "properties": { + "causes": { + "type": "array", + "title": "The Causes array includes more details associated with the StatusReason\nfailure. Not all StatusReasons may provide detailed causes.\n+optional", + "items": { + "$ref": "#/definitions/v1StatusCause" + } + }, + "group": { + "type": "string", + "title": "The group attribute of the resource associated with the status StatusReason.\n+optional" + }, + "kind": { + "type": "string", + "title": "The kind attribute of the resource associated with the status StatusReason.\nOn some operations may differ from the requested resource Kind.\nMore info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds\n+optional" + }, + "name": { + "type": "string", + "title": "The name attribute of the resource associated with the status StatusReason\n(when there is a single name which can be described).\n+optional" + }, + "retryAfterSeconds": { + "type": "integer", + "format": "int32", + "title": "If specified, the time in seconds before the operation should be retried. Some errors may indicate\nthe client must take an alternate action - for those errors this field may indicate how long to wait\nbefore taking the alternate action.\n+optional" + }, + "uid": { + "type": "string", + "title": "UID of the resource.\n(when there is a single resource which can be described).\nMore info: http://kubernetes.io/docs/user-guide/identifiers#uids\n+optional" + } + } + }, + "v1Time": { + "description": "Time is a wrapper around time.Time which supports correct\nmarshaling to YAML and JSON. Wrappers are provided for many\nof the factory methods that the time package offers.\n\n+protobuf.options.marshal=false\n+protobuf.as=Timestamp\n+protobuf.options.(gogoproto.goproto_stringer)=false", + "type": "object", + "properties": { + "nanos": { + "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive. This field may be limited in precision depending on context.", + "type": "integer", + "format": "int32" + }, + "seconds": { + "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.", + "type": "string", + "format": "int64" + } + } + }, + "v1alpha1AWSAuthConfig": { + "type": "object", + "title": "AWSAuthConfig is an AWS IAM authentication configuration", + "properties": { + "clusterName": { + "type": "string", + "title": "ClusterName contains AWS cluster name" + }, + "roleARN": { + "description": "RoleARN contains optional role ARN. If set then AWS IAM Authenticator assume a role to perform cluster operations instead of the default AWS credential provider chain.", + "type": "string" + } + } + }, + "v1alpha1AppProject": { + "type": "object", + "title": "AppProject provides a logical grouping of applications, providing controls for:\n* where the apps may deploy to (cluster whitelist)\n* what may be deployed (repository whitelist, resource whitelist/blacklist)\n* who can access these applications (roles, OIDC group claims bindings)\n* and what they can do (RBAC policies)\n* automation access to these roles (JWT tokens)\n+genclient\n+genclient:noStatus\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\n+kubebuilder:resource:path=appprojects,shortName=appproj;appprojs", + "properties": { + "metadata": { + "$ref": "#/definitions/v1ObjectMeta" + }, + "spec": { + "$ref": "#/definitions/v1alpha1AppProjectSpec" + } + } + }, + "v1alpha1AppProjectList": { + "type": "object", + "title": "AppProjectList is list of AppProject resources\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1AppProject" + } + }, + "metadata": { + "$ref": "#/definitions/v1ListMeta" + } + } + }, + "v1alpha1AppProjectSpec": { + "type": "object", + "title": "AppProjectSpec is the specification of an AppProject", + "properties": { + "clusterResourceWhitelist": { + "type": "array", + "title": "ClusterResourceWhitelist contains list of whitelisted cluster level resources", + "items": { + "$ref": "#/definitions/v1GroupKind" + } + }, + "description": { + "type": "string", + "title": "Description contains optional project description" + }, + "destinations": { + "type": "array", + "title": "Destinations contains list of destinations available for deployment", + "items": { + "$ref": "#/definitions/v1alpha1ApplicationDestination" + } + }, + "namespaceResourceBlacklist": { + "type": "array", + "title": "NamespaceResourceBlacklist contains list of blacklisted namespace level resources", + "items": { + "$ref": "#/definitions/v1GroupKind" + } + }, + "roles": { + "type": "array", + "title": "Roles are user defined RBAC roles associated with this project", + "items": { + "$ref": "#/definitions/v1alpha1ProjectRole" + } + }, + "sourceRepos": { + "type": "array", + "title": "SourceRepos contains list of git repository URLs which can be used for deployment", + "items": { + "type": "string" + } + } + } + }, + "v1alpha1Application": { + "type": "object", + "title": "Application is a definition of Application resource.\n+genclient\n+genclient:noStatus\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\n+kubebuilder:resource:path=applications,shortName=app;apps", + "properties": { + "metadata": { + "$ref": "#/definitions/v1ObjectMeta" + }, + "operation": { + "$ref": "#/definitions/v1alpha1Operation" + }, + "spec": { + "$ref": "#/definitions/v1alpha1ApplicationSpec" + }, + "status": { + "$ref": "#/definitions/v1alpha1ApplicationStatus" + } + } + }, + "v1alpha1ApplicationCondition": { + "type": "object", + "title": "ApplicationCondition contains details about current application condition", + "properties": { + "message": { + "type": "string", + "title": "Message contains human-readable message indicating details about condition" + }, + "type": { + "type": "string", + "title": "Type is an application condition type" + } + } + }, + "v1alpha1ApplicationDestination": { + "type": "object", + "title": "ApplicationDestination contains deployment destination information", + "properties": { + "namespace": { + "type": "string", + "title": "Namespace overrides the environment namespace value in the ksonnet app.yaml" + }, + "server": { + "type": "string", + "title": "Server overrides the environment server value in the ksonnet app.yaml" + } + } + }, + "v1alpha1ApplicationList": { + "type": "object", + "title": "ApplicationList is list of Application resources\n+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1Application" + } + }, + "metadata": { + "$ref": "#/definitions/v1ListMeta" + } + } + }, + "v1alpha1ApplicationSource": { + "description": "ApplicationSource contains information about github repository, path within repository and target application environment.", + "type": "object", + "properties": { + "directory": { + "$ref": "#/definitions/v1alpha1ApplicationSourceDirectory" + }, + "helm": { + "$ref": "#/definitions/v1alpha1ApplicationSourceHelm" + }, + "ksonnet": { + "$ref": "#/definitions/v1alpha1ApplicationSourceKsonnet" + }, + "kustomize": { + "$ref": "#/definitions/v1alpha1ApplicationSourceKustomize" + }, + "path": { + "type": "string", + "title": "Path is a directory path within the repository containing a" + }, + "plugin": { + "$ref": "#/definitions/v1alpha1ApplicationSourcePlugin" + }, + "repoURL": { + "type": "string", + "title": "RepoURL is the git repository URL of the application manifests" + }, + "targetRevision": { + "type": "string", + "title": "TargetRevision defines the commit, tag, or branch in which to sync the application to.\nIf omitted, will sync to HEAD" + } + } + }, + "v1alpha1ApplicationSourceDirectory": { + "type": "object", + "properties": { + "jsonnet": { + "$ref": "#/definitions/v1alpha1ApplicationSourceJsonnet" + }, + "recurse": { + "type": "boolean", + "format": "boolean" + } + } + }, + "v1alpha1ApplicationSourceHelm": { + "type": "object", + "title": "ApplicationSourceHelm holds helm specific options", + "properties": { + "parameters": { + "type": "array", + "title": "Parameters are parameters to the helm template", + "items": { + "$ref": "#/definitions/v1alpha1HelmParameter" + } + }, + "releaseName": { + "type": "string", + "title": "The Helm release name. If omitted it will use the application name" + }, + "valueFiles": { + "type": "array", + "title": "ValuesFiles is a list of Helm value files to use when generating a template", + "items": { + "type": "string" + } + } + } + }, + "v1alpha1ApplicationSourceJsonnet": { + "type": "object", + "title": "ApplicationSourceJsonnet holds jsonnet specific options", + "properties": { + "extVars": { + "type": "array", + "title": "ExtVars is a list of Jsonnet External Variables", + "items": { + "$ref": "#/definitions/v1alpha1JsonnetVar" + } + }, + "tlas": { + "type": "array", + "title": "TLAS is a list of Jsonnet Top-level Arguments", + "items": { + "$ref": "#/definitions/v1alpha1JsonnetVar" + } + } + } + }, + "v1alpha1ApplicationSourceKsonnet": { + "type": "object", + "title": "ApplicationSourceKsonnet holds ksonnet specific options", + "properties": { + "environment": { + "type": "string", + "title": "Environment is a ksonnet application environment name" + }, + "parameters": { + "type": "array", + "title": "Parameters are a list of ksonnet component parameter override values", + "items": { + "$ref": "#/definitions/v1alpha1KsonnetParameter" + } + } + } + }, + "v1alpha1ApplicationSourceKustomize": { + "type": "object", + "title": "ApplicationSourceKustomize holds kustomize specific options", + "properties": { + "commonLabels": { + "type": "object", + "title": "CommonLabels adds additional kustomize commonLabels", + "additionalProperties": { + "type": "string" + } + }, + "images": { + "type": "array", + "title": "Images are kustomize image overrides", + "items": { + "type": "string" + } + }, + "namePrefix": { + "type": "string", + "title": "NamePrefix is a prefix appended to resources for kustomize apps" + } + } + }, + "v1alpha1ApplicationSourcePlugin": { + "type": "object", + "title": "ApplicationSourcePlugin holds config management plugin specific options", + "properties": { + "env": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1EnvEntry" + } + }, + "name": { + "type": "string" + } + } + }, + "v1alpha1ApplicationSpec": { + "description": "ApplicationSpec represents desired application state. Contains link to repository with application definition and additional parameters link definition revision.", + "type": "object", + "properties": { + "destination": { + "$ref": "#/definitions/v1alpha1ApplicationDestination" + }, + "ignoreDifferences": { + "type": "array", + "title": "IgnoreDifferences controls resources fields which should be ignored during comparison", + "items": { + "$ref": "#/definitions/v1alpha1ResourceIgnoreDifferences" + } + }, + "info": { + "type": "array", + "title": "Infos contains a list of useful information (URLs, email addresses, and plain text) that relates to the application", + "items": { + "$ref": "#/definitions/v1alpha1Info" + } + }, + "project": { + "description": "Project is a application project name. Empty name means that application belongs to 'default' project.", + "type": "string" + }, + "source": { + "$ref": "#/definitions/v1alpha1ApplicationSource" + }, + "syncPolicy": { + "$ref": "#/definitions/v1alpha1SyncPolicy" + } + } + }, + "v1alpha1ApplicationStatus": { + "type": "object", + "title": "ApplicationStatus contains information about application sync, health status", + "properties": { + "conditions": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ApplicationCondition" + } + }, + "health": { + "$ref": "#/definitions/v1alpha1HealthStatus" + }, + "history": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1RevisionHistory" + } + }, + "observedAt": { + "$ref": "#/definitions/v1Time" + }, + "operationState": { + "$ref": "#/definitions/v1alpha1OperationState" + }, + "reconciledAt": { + "$ref": "#/definitions/v1Time" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceStatus" + } + }, + "sourceType": { + "type": "string" + }, + "summary": { + "$ref": "#/definitions/v1alpha1ApplicationSummary" + }, + "sync": { + "$ref": "#/definitions/v1alpha1SyncStatus" + } + } + }, + "v1alpha1ApplicationSummary": { + "type": "object", + "properties": { + "externalURLs": { + "description": "ExternalURLs holds all external URLs of application child resources.", + "type": "array", + "items": { + "type": "string" + } + }, + "images": { + "description": "Images holds all images of application child resources.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1alpha1ApplicationTree": { + "type": "object", + "title": "ApplicationTree holds nodes which belongs to the application", + "properties": { + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceNode" + } + } + } + }, + "v1alpha1ApplicationWatchEvent": { + "description": "ApplicationWatchEvent contains information about application change.", + "type": "object", + "properties": { + "application": { + "$ref": "#/definitions/v1alpha1Application" + }, + "type": { + "type": "string" + } + } + }, + "v1alpha1Cluster": { + "type": "object", + "title": "Cluster is the definition of a cluster resource", + "properties": { + "config": { + "$ref": "#/definitions/v1alpha1ClusterConfig" + }, + "connectionState": { + "$ref": "#/definitions/v1alpha1ConnectionState" + }, + "name": { + "type": "string", + "title": "Name of the cluster. If omitted, will use the server address" + }, + "server": { + "type": "string", + "title": "Server is the API server URL of the Kubernetes cluster" + } + } + }, + "v1alpha1ClusterConfig": { + "description": "ClusterConfig is the configuration attributes. This structure is subset of the go-client\nrest.Config with annotations added for marshalling.", + "type": "object", + "properties": { + "awsAuthConfig": { + "$ref": "#/definitions/v1alpha1AWSAuthConfig" + }, + "bearerToken": { + "description": "Server requires Bearer authentication. This client will not attempt to use\nrefresh tokens for an OAuth2 flow.\nTODO: demonstrate an OAuth2 compatible client.", + "type": "string" + }, + "password": { + "type": "string" + }, + "tlsClientConfig": { + "$ref": "#/definitions/v1alpha1TLSClientConfig" + }, + "username": { + "type": "string", + "title": "Server requires Basic authentication" + } + } + }, + "v1alpha1ClusterList": { + "description": "ClusterList is a collection of Clusters.", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1Cluster" + } + }, + "metadata": { + "$ref": "#/definitions/v1ListMeta" + } + } + }, + "v1alpha1ComparedTo": { + "type": "object", + "title": "ComparedTo contains application source and target which was used for resources comparison", + "properties": { + "destination": { + "$ref": "#/definitions/v1alpha1ApplicationDestination" + }, + "source": { + "$ref": "#/definitions/v1alpha1ApplicationSource" + } + } + }, + "v1alpha1ConnectionState": { + "type": "object", + "title": "ConnectionState contains information about remote resource connection state", + "properties": { + "attemptedAt": { + "$ref": "#/definitions/v1Time" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "v1alpha1EnvEntry": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "the name, usually uppercase" + }, + "value": { + "type": "string", + "title": "the value" + } + } + }, + "v1alpha1HealthStatus": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "v1alpha1HelmParameter": { + "type": "object", + "title": "HelmParameter is a parameter to a helm template", + "properties": { + "forceString": { + "type": "boolean", + "format": "boolean", + "title": "ForceString determines whether to tell Helm to interpret booleans and numbers as strings" + }, + "name": { + "type": "string", + "title": "Name is the name of the helm parameter" + }, + "value": { + "type": "string", + "title": "Value is the value for the helm parameter" + } + } + }, + "v1alpha1Info": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "v1alpha1InfoItem": { + "type": "object", + "title": "InfoItem contains human readable information about object", + "properties": { + "name": { + "description": "Name is a human readable title for this piece of information.", + "type": "string" + }, + "value": { + "description": "Value is human readable content.", + "type": "string" + } + } + }, + "v1alpha1JWTToken": { + "type": "object", + "title": "JWTToken holds the issuedAt and expiresAt values of a token", + "properties": { + "exp": { + "type": "string", + "format": "int64" + }, + "iat": { + "type": "string", + "format": "int64" + } + } + }, + "v1alpha1JsonnetVar": { + "type": "object", + "title": "JsonnetVar is a jsonnet variable", + "properties": { + "code": { + "type": "boolean", + "format": "boolean" + }, + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "v1alpha1KsonnetParameter": { + "type": "object", + "title": "KsonnetParameter is a ksonnet component parameter", + "properties": { + "component": { + "type": "string" + }, + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "v1alpha1KustomizeOptions": { + "type": "object", + "title": "KustomizeOptions are options for kustomize to use when building manifests", + "properties": { + "buildOptions": { + "type": "string", + "title": "BuildOptions is a string of build parameters to use when calling `kustomize build`" + } + } + }, + "v1alpha1Operation": { + "description": "Operation contains requested operation parameters.", + "type": "object", + "properties": { + "sync": { + "$ref": "#/definitions/v1alpha1SyncOperation" + } + } + }, + "v1alpha1OperationState": { + "description": "OperationState contains information about state of currently performing operation on application.", + "type": "object", + "properties": { + "finishedAt": { + "$ref": "#/definitions/v1Time" + }, + "message": { + "description": "Message hold any pertinent messages when attempting to perform operation (typically errors).", + "type": "string" + }, + "operation": { + "$ref": "#/definitions/v1alpha1Operation" + }, + "phase": { + "type": "string", + "title": "Phase is the current phase of the operation" + }, + "startedAt": { + "$ref": "#/definitions/v1Time" + }, + "syncResult": { + "$ref": "#/definitions/v1alpha1SyncOperationResult" + } + } + }, + "v1alpha1ProjectRole": { + "type": "object", + "title": "ProjectRole represents a role that has access to a project", + "properties": { + "description": { + "type": "string", + "title": "Description is a description of the role" + }, + "groups": { + "type": "array", + "title": "Groups are a list of OIDC group claims bound to this role", + "items": { + "type": "string" + } + }, + "jwtTokens": { + "type": "array", + "title": "JWTTokens are a list of generated JWT tokens bound to this role", + "items": { + "$ref": "#/definitions/v1alpha1JWTToken" + } + }, + "name": { + "type": "string", + "title": "Name is a name for this role" + }, + "policies": { + "type": "array", + "title": "Policies Stores a list of casbin formated strings that define access policies for the role in the project", + "items": { + "type": "string" + } + } + } + }, + "v1alpha1Repository": { + "type": "object", + "title": "Repository is a Git repository holding application configurations", + "properties": { + "connectionState": { + "$ref": "#/definitions/v1alpha1ConnectionState" + }, + "enableLfs": { + "type": "boolean", + "format": "boolean", + "title": "Whether git-lfs support should be enabled for this repo" + }, + "insecure": { + "type": "boolean", + "format": "boolean", + "title": "Whether the repo is insecure" + }, + "insecureIgnoreHostKey": { + "type": "boolean", + "format": "boolean", + "title": "InsecureIgnoreHostKey should not be used anymore, Insecure is favoured" + }, + "password": { + "type": "string", + "title": "Password for authenticating at the repo server" + }, + "repo": { + "type": "string", + "title": "URL of the repo" + }, + "sshPrivateKey": { + "type": "string", + "title": "SSH private key data for authenticating at the repo server" + }, + "tlsClientCertData": { + "type": "string", + "title": "TLS client cert data for authenticating at the repo server" + }, + "tlsClientCertKey": { + "type": "string", + "title": "TLS client cert key for authenticating at the repo server" + }, + "username": { + "type": "string", + "title": "Username for authenticating at the repo server" + } + } + }, + "v1alpha1RepositoryCertificate": { + "type": "object", + "title": "A RepositoryCertificate is either SSH known hosts entry or TLS certificate", + "properties": { + "certData": { + "type": "string", + "format": "byte", + "title": "Actual certificate data, protocol dependent" + }, + "certInfo": { + "type": "string", + "title": "Additional certificate info (e.g. SSH fingerprint, X509 CommonName)" + }, + "certSubType": { + "type": "string", + "title": "The sub type of the cert, i.e. \"ssh-rsa\"" + }, + "certType": { + "type": "string", + "title": "Type of certificate - currently \"https\" or \"ssh\"" + }, + "serverName": { + "type": "string", + "title": "Name of the server the certificate is intended for" + } + } + }, + "v1alpha1RepositoryCertificateList": { + "type": "object", + "title": "RepositoryCertificateList is a collection of RepositoryCertificates", + "properties": { + "items": { + "type": "array", + "title": "List of certificates to be processed", + "items": { + "$ref": "#/definitions/v1alpha1RepositoryCertificate" + } + }, + "metadata": { + "$ref": "#/definitions/v1ListMeta" + } + } + }, + "v1alpha1RepositoryList": { + "description": "RepositoryList is a collection of Repositories.", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1Repository" + } + }, + "metadata": { + "$ref": "#/definitions/v1ListMeta" + } + } + }, + "v1alpha1ResourceAction": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceActionParam" + } + } + } + }, + "v1alpha1ResourceActionParam": { + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "v1alpha1ResourceDiff": { + "type": "object", + "title": "ResourceDiff holds the diff of a live and target resource object", + "properties": { + "diff": { + "type": "string" + }, + "group": { + "type": "string" + }, + "hook": { + "type": "boolean", + "format": "boolean" + }, + "kind": { + "type": "string" + }, + "liveState": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "targetState": { + "type": "string" + } + } + }, + "v1alpha1ResourceIgnoreDifferences": { + "description": "ResourceIgnoreDifferences contains resource filter and list of json paths which should be ignored during comparison with live state.", + "type": "object", + "properties": { + "group": { + "type": "string" + }, + "jsonPointers": { + "type": "array", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + } + } + }, + "v1alpha1ResourceNetworkingInfo": { + "type": "object", + "title": "ResourceNetworkingInfo holds networking resource related information", + "properties": { + "externalURLs": { + "description": "ExternalURLs holds list of URLs which should be available externally. List is populated for ingress resources using rules hostnames.", + "type": "array", + "items": { + "type": "string" + } + }, + "ingress": { + "type": "array", + "items": { + "$ref": "#/definitions/v1LoadBalancerIngress" + } + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "targetLabels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "targetRefs": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceRef" + } + } + } + }, + "v1alpha1ResourceNode": { + "type": "object", + "title": "ResourceNode contains information about live resource and its children", + "properties": { + "health": { + "$ref": "#/definitions/v1alpha1HealthStatus" + }, + "images": { + "type": "array", + "items": { + "type": "string" + } + }, + "info": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1InfoItem" + } + }, + "networkingInfo": { + "$ref": "#/definitions/v1alpha1ResourceNetworkingInfo" + }, + "parentRefs": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1ResourceRef" + } + }, + "resourceRef": { + "$ref": "#/definitions/v1alpha1ResourceRef" + }, + "resourceVersion": { + "type": "string" + } + } + }, + "v1alpha1ResourceOverride": { + "type": "object", + "title": "ResourceOverride holds configuration to customize resource diffing and health assessment", + "properties": { + "actions": { + "type": "string" + }, + "healthLua": { + "type": "string" + }, + "ignoreDifferences": { + "type": "string" + } + } + }, + "v1alpha1ResourceRef": { + "type": "object", + "title": "ResourceRef includes fields which unique identify resource", + "properties": { + "group": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "v1alpha1ResourceResult": { + "type": "object", + "title": "ResourceResult holds the operation result details of a specific resource", + "properties": { + "group": { + "type": "string" + }, + "hookPhase": { + "type": "string", + "title": "the state of any operation associated with this resource OR hook\nnote: can contain values for non-hook resources" + }, + "hookType": { + "type": "string", + "title": "the type of the hook, empty for non-hook resources" + }, + "kind": { + "type": "string" + }, + "message": { + "type": "string", + "title": "message for the last sync OR operation" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "status": { + "type": "string", + "title": "the final result of the sync, this is be empty if the resources is yet to be applied/pruned and is always zero-value for hooks" + }, + "syncPhase": { + "type": "string", + "title": "indicates the particular phase of the sync that this is for" + }, + "version": { + "type": "string" + } + } + }, + "v1alpha1ResourceStatus": { + "type": "object", + "title": "ResourceStatus holds the current sync and health status of a resource", + "properties": { + "group": { + "type": "string" + }, + "health": { + "$ref": "#/definitions/v1alpha1HealthStatus" + }, + "hook": { + "type": "boolean", + "format": "boolean" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "requiresPruning": { + "type": "boolean", + "format": "boolean" + }, + "status": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "v1alpha1RevisionHistory": { + "type": "object", + "title": "RevisionHistory contains information relevant to an application deployment", + "properties": { + "deployedAt": { + "$ref": "#/definitions/v1Time" + }, + "id": { + "type": "string", + "format": "int64" + }, + "revision": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/v1alpha1ApplicationSource" + } + } + }, + "v1alpha1RevisionMetadata": { + "type": "object", + "title": "data about a specific revision within a repo", + "properties": { + "author": { + "type": "string", + "title": "who authored this revision,\ntypically their name and email, e.g. \"John Doe \",\nbut might not match this example" + }, + "date": { + "$ref": "#/definitions/v1Time" + }, + "message": { + "type": "string", + "title": "the message associated with the revision,\nprobably the commit message,\nthis is truncated to the first newline or 64 characters (which ever comes first)" + }, + "tags": { + "type": "array", + "title": "tags on the revision,\nnote - tags can move from one revision to another", + "items": { + "type": "string" + } + } + } + }, + "v1alpha1SyncOperation": { + "description": "SyncOperation contains sync operation details.", + "type": "object", + "properties": { + "dryRun": { + "type": "boolean", + "format": "boolean", + "title": "DryRun will perform a `kubectl apply --dry-run` without actually performing the sync" + }, + "manifests": { + "type": "array", + "title": "Manifests is an optional field that overrides sync source with a local directory for development", + "items": { + "type": "string" + } + }, + "prune": { + "type": "boolean", + "format": "boolean", + "title": "Prune deletes resources that are no longer tracked in git" + }, + "resources": { + "type": "array", + "title": "Resources describes which resources to sync", + "items": { + "$ref": "#/definitions/v1alpha1SyncOperationResource" + } + }, + "revision": { + "description": "Revision is the git revision in which to sync the application to.\nIf omitted, will use the revision specified in app spec.", + "type": "string" + }, + "source": { + "$ref": "#/definitions/v1alpha1ApplicationSource" + }, + "syncStrategy": { + "$ref": "#/definitions/v1alpha1SyncStrategy" + } + } + }, + "v1alpha1SyncOperationResource": { + "description": "SyncOperationResource contains resources to sync.", + "type": "object", + "properties": { + "group": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "v1alpha1SyncOperationResult": { + "type": "object", + "title": "SyncOperationResult represent result of sync operation", + "properties": { + "resources": { + "type": "array", + "title": "Resources holds the sync result of each individual resource", + "items": { + "$ref": "#/definitions/v1alpha1ResourceResult" + } + }, + "revision": { + "type": "string", + "title": "Revision holds the git commit SHA of the sync" + }, + "source": { + "$ref": "#/definitions/v1alpha1ApplicationSource" + } + } + }, + "v1alpha1SyncPolicy": { + "type": "object", + "title": "SyncPolicy controls when a sync will be performed in response to updates in git", + "properties": { + "automated": { + "$ref": "#/definitions/v1alpha1SyncPolicyAutomated" + } + } + }, + "v1alpha1SyncPolicyAutomated": { + "type": "object", + "title": "SyncPolicyAutomated controls the behavior of an automated sync", + "properties": { + "prune": { + "type": "boolean", + "format": "boolean", + "title": "Prune will prune resources automatically as part of automated sync (default: false)" + }, + "selfHeal": { + "type": "boolean", + "format": "boolean", + "title": "SelfHeal enables auto-syncing if (default: false)" + } + } + }, + "v1alpha1SyncStatus": { + "description": "SyncStatus is a comparison result of application spec and deployed application.", + "type": "object", + "properties": { + "comparedTo": { + "$ref": "#/definitions/v1alpha1ComparedTo" + }, + "revision": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "v1alpha1SyncStrategy": { + "type": "object", + "title": "SyncStrategy controls the manner in which a sync is performed", + "properties": { + "apply": { + "$ref": "#/definitions/v1alpha1SyncStrategyApply" + }, + "hook": { + "$ref": "#/definitions/v1alpha1SyncStrategyHook" + } + } + }, + "v1alpha1SyncStrategyApply": { + "type": "object", + "title": "SyncStrategyApply uses `kubectl apply` to perform the apply", + "properties": { + "force": { + "description": "Force indicates whether or not to supply the --force flag to `kubectl apply`.\nThe --force flag deletes and re-create the resource, when PATCH encounters conflict and has\nretried for 5 times.", + "type": "boolean", + "format": "boolean" + } + } + }, + "v1alpha1SyncStrategyHook": { + "description": "SyncStrategyHook will perform a sync using hooks annotations.\nIf no hook annotation is specified falls back to `kubectl apply`.", + "type": "object", + "properties": { + "syncStrategyApply": { + "$ref": "#/definitions/v1alpha1SyncStrategyApply" + } + } + }, + "v1alpha1TLSClientConfig": { + "type": "object", + "title": "TLSClientConfig contains settings to enable transport layer security", + "properties": { + "caData": { + "type": "string", + "format": "byte", + "title": "CAData holds PEM-encoded bytes (typically read from a root certificates bundle).\nCAData takes precedence over CAFile" + }, + "certData": { + "type": "string", + "format": "byte", + "title": "CertData holds PEM-encoded bytes (typically read from a client certificate file).\nCertData takes precedence over CertFile" + }, + "insecure": { + "description": "Server should be accessed without verifying the TLS certificate. For testing only.", + "type": "boolean", + "format": "boolean" + }, + "keyData": { + "type": "string", + "format": "byte", + "title": "KeyData holds PEM-encoded bytes (typically read from a client certificate key file).\nKeyData takes precedence over KeyFile" + }, + "serverName": { + "description": "ServerName is passed to the server for SNI and is used in the client to check server\ncertificates against. If ServerName is empty, the hostname used to contact the\nserver is used.", + "type": "string" + } + } + }, + "versionVersionMessage": { + "type": "object", + "title": "VersionMessage represents version of the Argo CD API server", + "properties": { + "BuildDate": { + "type": "string" + }, + "Compiler": { + "type": "string" + }, + "GitCommit": { + "type": "string" + }, + "GitTag": { + "type": "string" + }, + "GitTreeState": { + "type": "string" + }, + "GoVersion": { + "type": "string" + }, + "KsonnetVersion": { + "type": "string" + }, + "Platform": { + "type": "string" + }, + "Version": { + "type": "string" + } + } + } + } +} \ No newline at end of file From 387523b8537b6453ba15e4fba1e222210be0f3e2 Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Wed, 5 Jun 2024 13:17:25 +0530 Subject: [PATCH 6/8] chore: update branch --- go.mod | 2 +- go.sum | 4 ++-- vendor/modules.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 5946848437..a48ef740eb 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 - github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d + github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0 github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 github.com/evanphx/json-patch v5.6.0+incompatible github.com/gammazero/workerpool v1.1.3 diff --git a/go.sum b/go.sum index ad2f4c3d8a..c1f1d5d0ec 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADG github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 h1:AUTYcDnL6w6Ux+264VldYaOUQAP6pDZ5Tq8wCKJyiEg= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470/go.mod h1:JQxTCMmQisrpjzETJr0tzVadV+wW23rHEZAY7JVyK3s= -github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d h1:isvK4uvMYSkJWExrXn22nvXYOum7iygZ5Z887e5mx0g= -github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= +github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0 h1:ARbxkctmnFrTUpo3eo6kSCG0N0qN56LmR8jVkaQCn9E= +github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 h1:TElPRU69QedW7DIQiiQxtjwSQ6cK0fCTAMGvSLhP0ac= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534/go.mod h1:ypUknVph8Ph4dxSlrFoouf7wLedQxHku2LQwgRrdgS4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= diff --git a/vendor/modules.txt b/vendor/modules.txt index f535b90d7f..4c9c4c8566 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -377,7 +377,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.0.19-0.20240528110708-f6086d04927d +# github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0 ## explicit; go 1.20 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/cloud-provider-identifier From ac7706ca024f5afd36803f9dd555a395f8404825 Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Wed, 5 Jun 2024 19:19:03 +0530 Subject: [PATCH 7/8] chore: merge main --- env_gen.md | 1 + 1 file changed, 1 insertion(+) diff --git a/env_gen.md b/env_gen.md index e79c776351..43e17cf998 100644 --- a/env_gen.md +++ b/env_gen.md @@ -177,6 +177,7 @@ | NATS_MSG_MAX_AGE | 86400 | | | NATS_MSG_PROCESSING_BATCH_SIZE | 1 | | | NATS_SERVER_HOST | nats://devtron-nats.devtroncd:4222 | | + | NOTIFICATION_MEDIUM | rest | | | ORCH_HOST | http://devtroncd-orchestrator-service-prod.devtroncd/webhook/msg/nats | | | ORCH_TOKEN | | | | OTEL_COLLECTOR_URL | | | From f4b95b9a2bc276afed3735d9497bdb2e05b5119a Mon Sep 17 00:00:00 2001 From: komalreddy3 Date: Fri, 7 Jun 2024 11:32:24 +0530 Subject: [PATCH 8/8] chore: update common lib --- go.mod | 2 +- go.sum | 4 +-- .../common-lib/blob-storage/AwsS3Blob.go | 16 ++++++++++ .../common-lib/blob-storage/AzureBlob.go | 16 ++++++++++ .../common-lib/blob-storage/Bean.go | 16 ++++++++++ .../blob-storage/BlobStorageService.go | 16 ++++++++++ .../common-lib/blob-storage/BlobUtils.go | 16 ++++++++++ .../common-lib/blob-storage/GCPBlob.go | 16 ++++++++++ .../ProviderIdentifierService.go | 16 ++++++++++ .../cloud-provider-identifier/bean/bean.go | 16 ++++++++++ .../providers/alibaba.go | 16 ++++++++++ .../providers/aws.go | 16 ++++++++++ .../providers/azure.go | 16 ++++++++++ .../providers/digitalOcean.go | 16 ++++++++++ .../providers/google.go | 16 ++++++++++ .../providers/oracle.go | 16 ++++++++++ .../common-lib/constants/constants.go | 16 ++++++++++ .../common-lib/middlewares/recovery.go | 16 ++++++++++ .../common-lib/pubsub-lib/JetStreamUtil.go | 5 ++-- .../common-lib/pubsub-lib/NatsClient.go | 5 ++-- .../pubsub-lib/PubSubClientService.go | 16 ++++++++++ .../common-lib/pubsub-lib/metrics/metrics.go | 16 ++++++++++ .../pubsub-lib/model/PubSubClientBean.go | 16 ++++++++++ .../common-lib/utils/CommandExecutor.go | 16 ++++++++++ .../common-lib/utils/CommonUtils.go | 30 +++++++++---------- .../common-lib/utils/ErrorUtil.go | 16 ++++++++++ .../common-lib/utils/LogProvider.go | 5 ++-- .../common-lib/utils/bean/bean.go | 16 ++++++++++ .../common-lib/utils/http/HttpUtil.go | 16 ++++++++++ .../common-lib/utils/k8s/K8sUtil.go | 5 ++-- .../devtron-labs/common-lib/utils/k8s/bean.go | 16 ++++++++++ .../common-lib/utils/k8s/commonBean/bean.go | 16 ++++++++++ .../common-lib/utils/k8s/health/bean.go | 16 ++++++++++ .../common-lib/utils/k8s/health/health.go | 16 ++++++++++ .../utils/k8s/health/health_apiservice.go | 16 ++++++++++ .../utils/k8s/health/health_argo.go | 16 ++++++++++ .../utils/k8s/health/health_daemonset.go | 16 ++++++++++ .../utils/k8s/health/health_deployment.go | 16 ++++++++++ .../common-lib/utils/k8s/health/health_hpa.go | 16 ++++++++++ .../utils/k8s/health/health_ingress.go | 16 ++++++++++ .../common-lib/utils/k8s/health/health_job.go | 16 ++++++++++ .../common-lib/utils/k8s/health/health_pod.go | 16 ++++++++++ .../common-lib/utils/k8s/health/health_pvc.go | 16 ++++++++++ .../utils/k8s/health/health_replicaset.go | 16 ++++++++++ .../utils/k8s/health/health_service.go | 16 ++++++++++ .../utils/k8s/health/health_statefulset.go | 16 ++++++++++ .../utils/k8sObjectsUtil/DockerImageFinder.go | 16 ++++++++++ .../k8sObjectsUtil/EphemeralContainersUtil.go | 16 ++++++++++ .../utils/k8sObjectsUtil/ImageUtil.go | 16 ++++++++++ .../utils/k8sObjectsUtil/SecretUtil.go | 16 ++++++++++ .../utils/remoteConnection/bean/bean.go | 16 ++++++++++ .../common-lib/utils/yaml/YamlUtil.go | 19 ++++++++++-- vendor/modules.txt | 2 +- 53 files changed, 748 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index a48ef740eb..046e773ad9 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/deckarep/golang-set v1.8.0 github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 - github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0 + github.com/devtron-labs/common-lib v0.0.19-0.20240607054959-82c79c23b046 github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 github.com/evanphx/json-patch v5.6.0+incompatible github.com/gammazero/workerpool v1.1.3 diff --git a/go.sum b/go.sum index c1f1d5d0ec..6936909566 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,8 @@ github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADG github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470 h1:AUTYcDnL6w6Ux+264VldYaOUQAP6pDZ5Tq8wCKJyiEg= github.com/devtron-labs/authenticator v0.4.35-0.20240405091826-a91813c53470/go.mod h1:JQxTCMmQisrpjzETJr0tzVadV+wW23rHEZAY7JVyK3s= -github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0 h1:ARbxkctmnFrTUpo3eo6kSCG0N0qN56LmR8jVkaQCn9E= -github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= +github.com/devtron-labs/common-lib v0.0.19-0.20240607054959-82c79c23b046 h1:hOyqkgILg+eDttLV6X7OAAo9PKEHzInUmBTVy/EY/iI= +github.com/devtron-labs/common-lib v0.0.19-0.20240607054959-82c79c23b046/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534 h1:TElPRU69QedW7DIQiiQxtjwSQ6cK0fCTAMGvSLhP0ac= github.com/devtron-labs/protos v0.0.3-0.20240326053929-48e42d9d4534/go.mod h1:ypUknVph8Ph4dxSlrFoouf7wLedQxHku2LQwgRrdgS4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/AwsS3Blob.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/AwsS3Blob.go index a574f8e0e8..84707249cc 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/AwsS3Blob.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/AwsS3Blob.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package blob_storage import ( diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/AzureBlob.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/AzureBlob.go index 1193b25706..d2c4b9c859 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/AzureBlob.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/AzureBlob.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package blob_storage import ( diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/Bean.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/Bean.go index fb3f868a46..7309df86f1 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/Bean.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/Bean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package blob_storage type BlobStorageRequest struct { diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go index 7a8321b187..627021bc4e 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobStorageService.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package blob_storage import ( diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobUtils.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobUtils.go index 70f7782641..1581edb331 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobUtils.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/BlobUtils.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package blob_storage import ( diff --git a/vendor/github.com/devtron-labs/common-lib/blob-storage/GCPBlob.go b/vendor/github.com/devtron-labs/common-lib/blob-storage/GCPBlob.go index a518eeda3a..1a50e4bf16 100644 --- a/vendor/github.com/devtron-labs/common-lib/blob-storage/GCPBlob.go +++ b/vendor/github.com/devtron-labs/common-lib/blob-storage/GCPBlob.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package blob_storage import ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/ProviderIdentifierService.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/ProviderIdentifierService.go index 45e70e2587..32d498d15b 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/ProviderIdentifierService.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/ProviderIdentifierService.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package providerIdentifier import ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/bean/bean.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/bean/bean.go index 87e05c45e6..1c72d83f7e 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/bean/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/bean/bean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package bean const ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/alibaba.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/alibaba.go index 35760db24b..4439d898f7 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/alibaba.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/alibaba.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package providers import ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/aws.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/aws.go index 28df250e7e..355b07d61c 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/aws.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/aws.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package providers import ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/azure.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/azure.go index a631615c37..b8e9a9417f 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/azure.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/azure.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package providers import ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/digitalOcean.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/digitalOcean.go index 90261d4f35..4428b226e3 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/digitalOcean.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/digitalOcean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package providers import ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/google.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/google.go index 70b6a4392a..49da639694 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/google.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/google.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package providers import ( diff --git a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/oracle.go b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/oracle.go index 46c3fb01b3..59420d0e82 100644 --- a/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/oracle.go +++ b/vendor/github.com/devtron-labs/common-lib/cloud-provider-identifier/providers/oracle.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package providers import ( diff --git a/vendor/github.com/devtron-labs/common-lib/constants/constants.go b/vendor/github.com/devtron-labs/common-lib/constants/constants.go index 6ea4e161dc..7a51abeb85 100644 --- a/vendor/github.com/devtron-labs/common-lib/constants/constants.go +++ b/vendor/github.com/devtron-labs/common-lib/constants/constants.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package constants const PanicLogIdentifier = "DEVTRON_PANIC_RECOVER" diff --git a/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go b/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go index 804fbcb5b9..f4d73bfb17 100644 --- a/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go +++ b/vendor/github.com/devtron-labs/common-lib/middlewares/recovery.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package middlewares import ( diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go index c0363436ef..aea8fb3dc6 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go @@ -1,18 +1,17 @@ /* - * Copyright (c) 2020 Devtron Labs + * Copyright (c) 2020-2024. Devtron Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package pubsub_lib diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go index 5ebedbeb2e..14170c1c23 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/NatsClient.go @@ -1,18 +1,17 @@ /* - * Copyright (c) 2020 Devtron Labs + * Copyright (c) 2020-2024. Devtron Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package pubsub_lib diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go index ab3a1fa488..698ae3e4a0 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package pubsub_lib import ( diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go index 337217a1dc..f67c225f43 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/metrics/metrics.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package metrics import ( diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/model/PubSubClientBean.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/model/PubSubClientBean.go index 6074fe46c5..e7e23bd77c 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/model/PubSubClientBean.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/model/PubSubClientBean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package model const PUBLISH_SUCCESS = "SUCCESS" diff --git a/vendor/github.com/devtron-labs/common-lib/utils/CommandExecutor.go b/vendor/github.com/devtron-labs/common-lib/utils/CommandExecutor.go index b8608112eb..c6f89af66c 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/CommandExecutor.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/CommandExecutor.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package utils import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go b/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go index 7aea2c4e15..671e4502fd 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/CommonUtils.go @@ -1,18 +1,18 @@ /* -Copyright 2016 Skippbox, Ltd. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package utils @@ -25,7 +25,7 @@ import ( var chars = []rune("abcdefghijklmnopqrstuvwxyz0123456789") -//Generates random string +// Generates random string func Generate(size int) string { rand.Seed(time.Now().UnixNano()) var b strings.Builder diff --git a/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go index 72e388dba0..17222a7498 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/ErrorUtil.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package utils import "fmt" diff --git a/vendor/github.com/devtron-labs/common-lib/utils/LogProvider.go b/vendor/github.com/devtron-labs/common-lib/utils/LogProvider.go index 2dc9abb5e9..fe2925f8ba 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/LogProvider.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/LogProvider.go @@ -1,18 +1,17 @@ /* - * Copyright (c) 2020 Devtron Labs + * Copyright (c) 2020-2024. Devtron Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package utils diff --git a/vendor/github.com/devtron-labs/common-lib/utils/bean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/bean/bean.go index 761f490b8d..dc32dadbda 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/bean/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/bean/bean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package bean const ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go index ebff462aef..26edc4af69 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/http/HttpUtil.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package http import "net/http" diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go index ac06485384..cfecc68a9b 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go @@ -1,18 +1,17 @@ /* - * Copyright (c) 2020 Devtron Labs + * Copyright (c) 2020-2024. Devtron Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ package k8s diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go index 0e5b8da2c7..4d6da10889 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/bean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package k8s import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go index a5ef4afc54..3383def208 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/commonBean/bean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package commonBean import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/bean.go index 4e0760e246..54eafc41d5 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/bean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health // Represents resource health status diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health.go index 79b289b91b..8118b49cb0 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_apiservice.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_apiservice.go index 9cba3e9925..9a86e6e857 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_apiservice.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_apiservice.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_argo.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_argo.go index 478d942284..c17c72045d 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_argo.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_argo.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_daemonset.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_daemonset.go index f130569339..4e6d2472a5 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_daemonset.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_daemonset.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_deployment.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_deployment.go index dcc3b23246..003d7565cf 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_deployment.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_deployment.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_hpa.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_hpa.go index db603a62dc..5465c9979e 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_hpa.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_hpa.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_ingress.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_ingress.go index 87de2d3e97..0f0ea3ab89 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_ingress.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_ingress.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_job.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_job.go index 44d1c5c46c..b49175f4e0 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_job.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_job.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pod.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pod.go index c17c08823c..d066f20cfa 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pod.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pod.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pvc.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pvc.go index 3ad96cd55f..8dd95be65d 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pvc.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_pvc.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_replicaset.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_replicaset.go index f92b36f105..6a9a2972de 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_replicaset.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_replicaset.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_service.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_service.go index 7e9698e855..16e28a71e5 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_service.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_service.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_statefulset.go b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_statefulset.go index d42d7eb9df..2811d36e8d 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_statefulset.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8s/health/health_statefulset.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package health import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go index e4a858d51f..b99c6386b3 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/DockerImageFinder.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package k8sObjectsUtil import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/EphemeralContainersUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/EphemeralContainersUtil.go index 805607fb98..95c590e959 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/EphemeralContainersUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/EphemeralContainersUtil.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package k8sObjectsUtil import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go index 54700f2433..da996c0c2f 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/ImageUtil.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package k8sObjectsUtil import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/SecretUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/SecretUtil.go index 6a3d4c2e51..3dd8272f78 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/SecretUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/k8sObjectsUtil/SecretUtil.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package k8sObjectsUtil import ( diff --git a/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go index 15fedc710d..20bfaf1ef7 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package bean type RemoteConnectionMethod string diff --git a/vendor/github.com/devtron-labs/common-lib/utils/yaml/YamlUtil.go b/vendor/github.com/devtron-labs/common-lib/utils/yaml/YamlUtil.go index e9035ac286..d98e5f2e49 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/yaml/YamlUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/yaml/YamlUtil.go @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2024. Devtron Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package yamlUtil import ( @@ -10,7 +26,6 @@ import ( "sigs.k8s.io/yaml" ) - // SplitYAMLs splits a YAML file into unstructured objects. Returns list of all unstructured objects // found in the yaml. If an error occurs, returns objects that have been parsed so far too. func SplitYAMLs(yamlData []byte) ([]unstructured.Unstructured, error) { @@ -39,4 +54,4 @@ func SplitYAMLs(yamlData []byte) ([]unstructured.Unstructured, error) { objs = append(objs, u) } return objs, nil -} \ No newline at end of file +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 4c9c4c8566..5f2332b432 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -377,7 +377,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.0.19-0.20240605073511-1448aa5b15d0 +# github.com/devtron-labs/common-lib v0.0.19-0.20240607054959-82c79c23b046 ## explicit; go 1.20 github.com/devtron-labs/common-lib/blob-storage github.com/devtron-labs/common-lib/cloud-provider-identifier