Skip to content

Commit de25e0d

Browse files
prkhrkatiamayushm
authored andcommitted
fix: Notifier v1 removed (#6705)
* notifier v1 removed * notifier v1 removed
1 parent a1034e4 commit de25e0d

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

client/events/EventClient.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
type EventClientConfig struct {
4040
DestinationURL string `env:"EVENT_URL" envDefault:"http://localhost:3000/notify" description:"Notifier service url"`
4141
NotificationMedium NotificationMedium `env:"NOTIFICATION_MEDIUM" envDefault:"rest" description:"notification medium"`
42-
EnableNotifierV2 bool `env:"ENABLE_NOTIFIER_V2" envDefault:"false" description:"enable notifier v2"`
4342
}
4443
type NotificationMedium string
4544

@@ -243,7 +242,7 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
243242
impl.logger.Debugw("event before send", "event", event)
244243

245244
// Step 1: Create payload and destination URL based on config
246-
bodyBytes, destinationUrl, err := impl.createPayloadAndDestination(event)
245+
bodyBytes, destinationUrl, err := impl.createV2PayloadAndDestination(event)
247246
if err != nil {
248247
return false, err
249248
}
@@ -252,13 +251,6 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
252251
return impl.deliverEvent(bodyBytes, destinationUrl)
253252
}
254253

255-
func (impl *EventRESTClientImpl) createPayloadAndDestination(event Event) ([]byte, string, error) {
256-
if impl.config.EnableNotifierV2 {
257-
return impl.createV2PayloadAndDestination(event)
258-
}
259-
return impl.createDefaultPayloadAndDestination(event)
260-
}
261-
262254
func (impl *EventRESTClientImpl) createV2PayloadAndDestination(event Event) ([]byte, string, error) {
263255
destinationUrl := impl.config.DestinationURL + "/v2"
264256

@@ -302,15 +294,6 @@ func (impl *EventRESTClientImpl) createV2PayloadAndDestination(event Event) ([]b
302294
return bodyBytes, destinationUrl, nil
303295
}
304296

305-
func (impl *EventRESTClientImpl) createDefaultPayloadAndDestination(event Event) ([]byte, string, error) {
306-
bodyBytes, err := json.Marshal(event)
307-
if err != nil {
308-
impl.logger.Errorw("error while marshaling event request", "err", err)
309-
return nil, "", err
310-
}
311-
return bodyBytes, impl.config.DestinationURL, nil
312-
}
313-
314297
func (impl *EventRESTClientImpl) processNotificationSettings(notificationSettings []repository.NotificationSettings) ([]*repository.NotificationSettingsBean, error) {
315298
notificationSettingsBean := make([]*repository.NotificationSettingsBean, 0)
316299
for _, item := range notificationSettings {

env_gen.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

env_gen.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@
181181
| ECR_REPO_NAME_PREFIX | string |test/ | Prefix for ECR repo to be created in does not exist | | false |
182182
| ENABLE_ASYNC_ARGO_CD_INSTALL_DEVTRON_CHART | bool |false | To enable async installation of gitops application | | false |
183183
| ENABLE_ASYNC_INSTALL_DEVTRON_CHART | bool |false | To enable async installation of no-gitops application | | false |
184-
| ENABLE_NOTIFIER_V2 | bool |false | enable notifier v2 | | false |
185184
| EPHEMERAL_SERVER_VERSION_REGEX | string |v[1-9]\.\b(2[3-9]\|[3-9][0-9])\b.* | ephemeral containers support version regex that is compared with k8sServerVersion | | false |
186185
| EVENT_URL | string |http://localhost:3000/notify | Notifier service url | | false |
187186
| EXECUTE_WIRE_NIL_CHECKER | bool |false | checks for any nil pointer in wire.go | | false |

0 commit comments

Comments
 (0)