diff --git a/client/events/EventClient.go b/client/events/EventClient.go index 6558080145..4cfbf79661 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{} @@ -238,6 +242,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 +261,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..a7d1a05866 --- /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, err := 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/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 | | | diff --git a/go.mod b/go.mod index a4ccb6f9d3..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.18-0.20240524141543-f4ed1281e694 + 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 215c25546c..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.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.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 93af19e669..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 @@ -104,6 +103,9 @@ const ( 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 { @@ -150,6 +152,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}, + 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}, } @@ -186,6 +189,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 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..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 @@ -76,6 +75,7 @@ func (ncc NatsClientConfig) GetDefaultNatsStreamConfig() NatsStreamConfig { type StreamConfig struct { MaxAge time.Duration `json:"max_age"` } + type NatsStreamConfig struct { StreamConfig StreamConfig `json:"streamConfig"` } 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..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 ( @@ -99,6 +115,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) @@ -136,6 +153,7 @@ func (impl PubSubClientServiceImpl) Subscribe(topic string, callback func(msg *m return err } go impl.startListeningForEvents(processingBatchSize, channel, callback, loggerFunc, validations...) + impl.Logger.Infow("Successfully subscribed with Nats", "stream", streamName, "topic", topic, "queue", queueName, "consumer", consumerName) return nil } @@ -148,6 +166,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!!") } 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 8bb7b79ff6..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.18-0.20240524141543-f4ed1281e694 +# 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