-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Issue 1285-: SendMail task was failing to execute successfully #1286
Conversation
|
Diff between version 0.1 and 0.2diff --git a/task/sendmail/0.1/README.md b/task/sendmail/0.2/README.md
index aafe880..9f56ca9 100644
--- a/task/sendmail/0.1/README.md
+++ b/task/sendmail/0.2/README.md
@@ -5,7 +5,7 @@ This task sends a simple email to receivers via SMTP server
## Install the Task and create a secret
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.1/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.2/raw
```
Create a secret that has the SMTP server information
diff --git a/task/sendmail/0.1/sendmail.yaml b/task/sendmail/0.2/sendmail.yaml
index b512852..1327dfe 100644
--- a/task/sendmail/0.1/sendmail.yaml
+++ b/task/sendmail/0.2/sendmail.yaml
@@ -53,8 +53,11 @@ spec:
if tls == 'True':
context = ssl.create_default_context()
server = smtplib.SMTP_SSL(smtp_server, port, context=context)
+ server.ehlo()
else:
server = smtplib.SMTP(smtp_server, port)
+ server.ehlo()
+ server.starttls()
if password != '':
server.login(user, password)
for receiver in [item for item in receiver_emails.split(' ') if item]: |
Catlin Output
|
/assign @akihikokuroda |
Diff between version 0.1 and 0.2diff --git a/task/sendmail/0.1/README.md b/task/sendmail/0.2/README.md
index aafe880..9f56ca9 100644
--- a/task/sendmail/0.1/README.md
+++ b/task/sendmail/0.2/README.md
@@ -5,7 +5,7 @@ This task sends a simple email to receivers via SMTP server
## Install the Task and create a secret
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.1/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.2/raw
```
Create a secret that has the SMTP server information
diff --git a/task/sendmail/0.1/sendmail.yaml b/task/sendmail/0.2/sendmail.yaml
index b512852..31f2536 100644
--- a/task/sendmail/0.1/sendmail.yaml
+++ b/task/sendmail/0.2/sendmail.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: sendmail
labels:
- app.kubernetes.io/version: "0.1"
+ app.kubernetes.io/version: "0.2"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: Messaging
@@ -53,8 +53,11 @@ spec:
if tls == 'True':
context = ssl.create_default_context()
server = smtplib.SMTP_SSL(smtp_server, port, context=context)
+ server.ehlo()
else:
server = smtplib.SMTP(smtp_server, port)
+ server.ehlo()
+ server.starttls()
if password != '':
server.login(user, password)
for receiver in [item for item in receiver_emails.split(' ') if item]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you squash the commits to one and change the subject in PR and commit?
You have to change the email in git using: |
Diff between version 0.1 and 0.2diff --git a/task/sendmail/0.1/README.md b/task/sendmail/0.2/README.md
index aafe880..9f56ca9 100644
--- a/task/sendmail/0.1/README.md
+++ b/task/sendmail/0.2/README.md
@@ -5,7 +5,7 @@ This task sends a simple email to receivers via SMTP server
## Install the Task and create a secret
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.1/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.2/raw
```
Create a secret that has the SMTP server information
diff --git a/task/sendmail/0.1/sendmail.yaml b/task/sendmail/0.2/sendmail.yaml
index b512852..31f2536 100644
--- a/task/sendmail/0.1/sendmail.yaml
+++ b/task/sendmail/0.2/sendmail.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: sendmail
labels:
- app.kubernetes.io/version: "0.1"
+ app.kubernetes.io/version: "0.2"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: Messaging
@@ -53,8 +53,11 @@ spec:
if tls == 'True':
context = ssl.create_default_context()
server = smtplib.SMTP_SSL(smtp_server, port, context=context)
+ server.ehlo()
else:
server = smtplib.SMTP(smtp_server, port)
+ server.ehlo()
+ server.starttls()
if password != '':
server.login(user, password)
for receiver in [item for item in receiver_emails.split(' ') if item]: |
@sudhishmk, can you please fix the CLA? |
/easycla |
@vinamra28 Done |
Diff between version 0.1 and 0.2diff --git a/task/sendmail/0.1/README.md b/task/sendmail/0.2/README.md
index aafe880..9f56ca9 100644
--- a/task/sendmail/0.1/README.md
+++ b/task/sendmail/0.2/README.md
@@ -5,7 +5,7 @@ This task sends a simple email to receivers via SMTP server
## Install the Task and create a secret
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.1/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.2/raw
```
Create a secret that has the SMTP server information
diff --git a/task/sendmail/0.1/sendmail.yaml b/task/sendmail/0.2/sendmail.yaml
index b512852..31f2536 100644
--- a/task/sendmail/0.1/sendmail.yaml
+++ b/task/sendmail/0.2/sendmail.yaml
@@ -3,7 +3,7 @@ kind: Task
metadata:
name: sendmail
labels:
- app.kubernetes.io/version: "0.1"
+ app.kubernetes.io/version: "0.2"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: Messaging
@@ -53,8 +53,11 @@ spec:
if tls == 'True':
context = ssl.create_default_context()
server = smtplib.SMTP_SSL(smtp_server, port, context=context)
+ server.ehlo()
else:
server = smtplib.SMTP(smtp_server, port)
+ server.ehlo()
+ server.starttls()
if password != '':
server.login(user, password)
for receiver in [item for item in receiver_emails.split(' ') if item]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @sudhishmk, apologies for seeing this late. Can you please take a look at following reviews. Can probably merge after this
Diff between version 0.1 and 0.2diff --git a/task/sendmail/0.1/README.md b/task/sendmail/0.2/README.md
index aafe880..1762993 100644
--- a/task/sendmail/0.1/README.md
+++ b/task/sendmail/0.2/README.md
@@ -5,7 +5,7 @@ This task sends a simple email to receivers via SMTP server
## Install the Task and create a secret
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.1/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.2/raw
```
Create a secret that has the SMTP server information
@@ -60,7 +60,7 @@ The Task can be run on `linux/amd64`, `linux/s390x`, `linux/arm64` and `linux/pp
This TaskRun runs the Task to send an email to the receivers via the SMTP server.
```
-apiVersion: tekton.dev/v1beta1
+apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
name: mail-taskrun
diff --git a/task/sendmail/0.1/sendmail.yaml b/task/sendmail/0.2/sendmail.yaml
index b512852..5e8c460 100644
--- a/task/sendmail/0.1/sendmail.yaml
+++ b/task/sendmail/0.2/sendmail.yaml
@@ -1,9 +1,9 @@
-apiVersion: tekton.dev/v1beta1
+apiVersion: tekton.dev/v1
kind: Task
metadata:
name: sendmail
labels:
- app.kubernetes.io/version: "0.1"
+ app.kubernetes.io/version: "0.2"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: Messaging
@@ -32,7 +32,7 @@ spec:
description: recipient email addresses (space delimited list)
steps:
- name: send
- image: docker.io/library/python:3.8-alpine@sha256:e11bbd37d4371894e954421b85dbe8dd4eb7198d7cb4ed144ab529f19f57c3f1 #tag: 3.8-alpine
+ image: docker.io/library/python:3.12-alpine@sha256:c2f41e6a5a67bc39b95be3988dd19fbd05d1b82375c46d9826c592cca014d4de #tag: 3.12-alpine
script: |
#!/usr/bin/env python3
import smtplib, ssl, os
@@ -53,8 +53,11 @@ spec:
if tls == 'True':
context = ssl.create_default_context()
server = smtplib.SMTP_SSL(smtp_server, port, context=context)
+ server.ehlo()
else:
server = smtplib.SMTP(smtp_server, port)
+ server.ehlo()
+ server.starttls()
if password != '':
server.login(user, password)
for receiver in [item for item in receiver_emails.split(' ') if item]: |
also can you please squash the commits once all the comments are addressed? |
Catlin Output
Catlin script lint Output
|
Diff between version 0.1 and 0.2diff --git a/task/sendmail/0.1/README.md b/task/sendmail/0.2/README.md
index aafe880..1762993 100644
--- a/task/sendmail/0.1/README.md
+++ b/task/sendmail/0.2/README.md
@@ -5,7 +5,7 @@ This task sends a simple email to receivers via SMTP server
## Install the Task and create a secret
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.1/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.2/raw
```
Create a secret that has the SMTP server information
@@ -60,7 +60,7 @@ The Task can be run on `linux/amd64`, `linux/s390x`, `linux/arm64` and `linux/pp
This TaskRun runs the Task to send an email to the receivers via the SMTP server.
```
-apiVersion: tekton.dev/v1beta1
+apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
name: mail-taskrun
diff --git a/task/sendmail/0.1/sendmail.yaml b/task/sendmail/0.2/sendmail.yaml
index b512852..9c59010 100644
--- a/task/sendmail/0.1/sendmail.yaml
+++ b/task/sendmail/0.2/sendmail.yaml
@@ -1,11 +1,11 @@
-apiVersion: tekton.dev/v1beta1
+apiVersion: tekton.dev/v1
kind: Task
metadata:
name: sendmail
labels:
- app.kubernetes.io/version: "0.1"
+ app.kubernetes.io/version: "0.2"
annotations:
- tekton.dev/pipelines.minVersion: "0.12.1"
+ tekton.dev/pipelines.minVersion: "0.50.0"
tekton.dev/categories: Messaging
tekton.dev/tags: mail
tekton.dev/displayName: "send mail"
@@ -32,7 +32,7 @@ spec:
description: recipient email addresses (space delimited list)
steps:
- name: send
- image: docker.io/library/python:3.8-alpine@sha256:e11bbd37d4371894e954421b85dbe8dd4eb7198d7cb4ed144ab529f19f57c3f1 #tag: 3.8-alpine
+ image: docker.io/library/python:3.12-alpine@sha256:c2f41e6a5a67bc39b95be3988dd19fbd05d1b82375c46d9826c592cca014d4de #tag: 3.12-alpine
script: |
#!/usr/bin/env python3
import smtplib, ssl, os
@@ -53,8 +53,11 @@ spec:
if tls == 'True':
context = ssl.create_default_context()
server = smtplib.SMTP_SSL(smtp_server, port, context=context)
+ server.ehlo()
else:
server = smtplib.SMTP(smtp_server, port)
+ server.ehlo()
+ server.starttls()
if password != '':
server.login(user, password)
for receiver in [item for item in receiver_emails.split(' ') if item]: |
Diff between version 0.1 and 0.2diff --git a/task/sendmail/0.1/README.md b/task/sendmail/0.2/README.md
index aafe880..1762993 100644
--- a/task/sendmail/0.1/README.md
+++ b/task/sendmail/0.2/README.md
@@ -5,7 +5,7 @@ This task sends a simple email to receivers via SMTP server
## Install the Task and create a secret
```
-kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.1/raw
+kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/sendmail/0.2/raw
```
Create a secret that has the SMTP server information
@@ -60,7 +60,7 @@ The Task can be run on `linux/amd64`, `linux/s390x`, `linux/arm64` and `linux/pp
This TaskRun runs the Task to send an email to the receivers via the SMTP server.
```
-apiVersion: tekton.dev/v1beta1
+apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
name: mail-taskrun
diff --git a/task/sendmail/0.1/sendmail.yaml b/task/sendmail/0.2/sendmail.yaml
index b512852..9c59010 100644
--- a/task/sendmail/0.1/sendmail.yaml
+++ b/task/sendmail/0.2/sendmail.yaml
@@ -1,11 +1,11 @@
-apiVersion: tekton.dev/v1beta1
+apiVersion: tekton.dev/v1
kind: Task
metadata:
name: sendmail
labels:
- app.kubernetes.io/version: "0.1"
+ app.kubernetes.io/version: "0.2"
annotations:
- tekton.dev/pipelines.minVersion: "0.12.1"
+ tekton.dev/pipelines.minVersion: "0.50.0"
tekton.dev/categories: Messaging
tekton.dev/tags: mail
tekton.dev/displayName: "send mail"
@@ -32,7 +32,7 @@ spec:
description: recipient email addresses (space delimited list)
steps:
- name: send
- image: docker.io/library/python:3.8-alpine@sha256:e11bbd37d4371894e954421b85dbe8dd4eb7198d7cb4ed144ab529f19f57c3f1 #tag: 3.8-alpine
+ image: docker.io/library/python:3.12-alpine@sha256:c2f41e6a5a67bc39b95be3988dd19fbd05d1b82375c46d9826c592cca014d4de #tag: 3.12-alpine
script: |
#!/usr/bin/env python3
import smtplib, ssl, os
@@ -53,8 +53,11 @@ spec:
if tls == 'True':
context = ssl.create_default_context()
server = smtplib.SMTP_SSL(smtp_server, port, context=context)
+ server.ehlo()
else:
server = smtplib.SMTP(smtp_server, port)
+ server.ehlo()
+ server.starttls()
if password != '':
server.login(user, password)
for receiver in [item for item in receiver_emails.split(' ') if item]: |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vinamra28 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes to fix sendmail task issue -: SendMail task was failing to execute successfully
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
contains
/kind <type>
. Valid types are bug, cleanup, design, documentation,feature, flake, misc, question, tep
File path follows
<kind>/<name>/<version>/name.yaml
Has
README.md
at<kind>/<name>/<version>/README.md
Has mandatory
metadata.labels
-app.kubernetes.io/version
the same as the<version>
of the resourceHas mandatory
metadata.annotations
tekton.dev/pipelines.minVersion
mandatory
spec.description
follows the conventionSee the contribution guide for more details.