-
Notifications
You must be signed in to change notification settings - Fork 515
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: disable api update if disabled from UI #3487
Conversation
pkg/pipeline/PipelineBuilder.go
Outdated
impl.logger.Errorw("exception while getting unique client id", "error", err) | ||
return nil, err | ||
} | ||
cm, err := impl.K8sUtil.GetConfigMap(ConfigMapNamespace, DashboardConfigMap, client) |
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.
handle error here
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.
done
return nil, err | ||
} | ||
cm, err := impl.K8sUtil.GetConfigMap(ConfigMapNamespace, DashboardConfigMap, client) | ||
datamap := cm.Data |
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.
What if cm is nil, handle that case also
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.
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.
not able to see it handled
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.
might not be showing that time, handled it.
pkg/pipeline/PipelineBuilder.go
Outdated
@@ -68,6 +68,9 @@ import ( | |||
"go.uber.org/zap" | |||
) | |||
|
|||
const DashboardConfigMap = "dashboard-cm" | |||
const ConfigMapNamespace = "devtroncd" |
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.
check similar constants already used, remove namespace const.
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.
dashboard-cm const is not used, removed namespace const.
return nil, err | ||
} | ||
cm, err := impl.K8sUtil.GetConfigMap(ConfigMapNamespace, DashboardConfigMap, client) | ||
datamap := cm.Data |
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.
not able to see it handled
@@ -1413,6 +1418,24 @@ func (impl PipelineBuilderImpl) PatchCiPipeline(request *bean.CiPatchRequest) (c | |||
ciConfig.AppWorkflowId = request.AppWorkflowId | |||
ciConfig.UserId = request.UserId | |||
if request.CiPipeline != nil { | |||
client, err := impl.K8sUtil.GetClientForInCluster() |
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.
will it works only for in cluster ? if not handle by cluster id.
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 working .
pkg/pipeline/PipelineBuilder.go
Outdated
return nil, err | ||
} | ||
datamap := cm.Data | ||
forceScanConfig, err := strconv.ParseBool(datamap["FORCE_SECURITY_SCANNING"]) |
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 nil check for datamap and add constant for 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.
done
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
141558 | Generic High Entropy Secret | 9880939 | scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/env-values.yaml | View secret |
2763127 | Generic High Entropy Secret | 9880939 | scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/secrets-test-values.yaml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
SonarCloud Quality Gate failed.
|
Description
Disable the API Update if the force security scanning is abled from UI.
Fixes #2574
How Has This Been Tested?
Tested all the using cases manually by Postman.
Checklist: