-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add Results configuration in tekton config #2398
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
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 create documentation for this PR?
@pratap0007 include the doc changes[1] on this PR |
dbb72d6
to
42f99c8
Compare
The following is the coverage report on the affected files.
|
42f99c8
to
a1ce3b9
Compare
The following is the coverage report on the affected files.
|
1c5b5ff
to
13655eb
Compare
The following is the coverage report on the affected files.
|
13655eb
to
055a55b
Compare
The following is the coverage report on the affected files.
|
/test pull-tekton-operator-integration-tests |
The following is the coverage report on the affected files.
|
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.
@pratap0007 Please address the review comments, It looks fine.
00bbc52
to
0260ad4
Compare
The following is the coverage report on the affected files.
|
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.
Your modification might still need a pull request to add end-to-end tests. 😆
|
||
_, err := r.kubeClientSet.CoreV1().Secrets(tr.Spec.TargetNamespace).Create(ctx, secret, metav1.CreateOptions{}) | ||
if err != nil { | ||
logger.Error(err) |
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.
Same as above.
tr.Status.MarkDependencyMissing(fmt.Sprintf("Default db %s creation is failing", DbSecretName)) | ||
return err | ||
} | ||
} |
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.
The current writing places a significant mental burden.
It is necessary to consider whether the final return nil is accurate.
Would this be better?
if err == nil {
return nil
}
if !apierrors.IsNotFound(err) {
// logger
return err
}
newDBSecret := r.getDBSecret(DbSecretName, tr.Spec.TargetNamespace, tr)
...
0260ad4
to
70f1a26
Compare
The following is the coverage report on the affected files.
|
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.
👍
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: l-qing The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
70f1a26
to
71f5652
Compare
The following is the coverage report on the affected files.
|
71f5652
to
7d696c2
Compare
The following is the coverage report on the affected files.
|
7d696c2
to
00091f3
Compare
The following is the coverage report on the affected files.
|
/test pull-tekton-operator-integration-tests |
/retest |
1 similar comment
/retest |
} | ||
|
||
notBefore := time.Now() | ||
notAfter := notBefore.Add(365 * 24 * time.Hour) |
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.
We should document the fact that we dont rotate the tls certificate if generated via the operator
// TODO: And remove this check in future release. | ||
if err := r.validateSecretsAreCreated(ctx, tr); err != nil { | ||
return err | ||
// If external database is disable then create default database and tls secret |
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.
If the external database is disabled, create a default database and a TLS secret.
Otherwise, verify if the default database secret is already created, and ensure the TLS secret is also created.
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.
Are we sure that the code below creates a database ? it seems jsut creating creds
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.
Are we sure that the code below creates a database ? it seems jsut creating creds
yes, it creates the database
00091f3
to
34b0e4d
Compare
The following is the coverage report on the affected files.
|
Type: corev1.SecretTypeOpaque, | ||
StringData: map[string]string{}, | ||
} | ||
password, _ := generateRandomBaseString(20) |
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.
We should handle the error of generateRandomBaseString
// Create Kubernetes TLS secret | ||
err = r.createKubernetesTLSSecret(ctx, tr.Spec.TargetNamespace, TlsSecretName, certPEM, keyPEM, tr) | ||
if err != nil { | ||
logger.Fatalf("failed to create TLS secret %s in namespace %s: %v", TlsSecretName, tr.Spec.TargetNamespace, err) |
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.
use Errof instead of Fatal
if err != nil { | ||
return nil, nil, err | ||
} | ||
keyPEM = pem.EncodeToMemory(&pem.Block{Type: "RSA PRIVATE KEY", Bytes: privBytes}) |
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.
Add constante for RSAPrivateKeyBlockType = "RSA PRIVATE KEY"
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.
You are using RSA type with x509.MarshalECPrivateKey(priv) ? Should be type EC Private KEY , right ?
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.
yes, it should be EC Private KEY
return nil, nil, err | ||
} | ||
|
||
certPEM = pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: certDER}) |
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.
use constante CertificateBlockType = "CERTIFICATE"
} | ||
password, _ := generateRandomBaseString(20) | ||
s.StringData["POSTGRES_PASSWORD"] = password | ||
s.StringData["POSTGRES_USER"] = "result" |
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.
Use constant
This will add the Results configuration to the tekton config and will be installed by default through tekton config Signed-off-by: Shiv Verma <[email protected]>
34b0e4d
to
e629301
Compare
/retest |
The following is the coverage report on the affected files.
|
/retest |
/test pull-tekton-operator-integration-tests |
@pratap0007: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
installed by default through tekton config
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lint
before submitting a PRSee the contribution guide for more details.
Release Notes