-
Notifications
You must be signed in to change notification settings - Fork 41
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
allow custom user renovate configs, in config maps, #372
base: main
Are you sure you want to change the base?
Conversation
bd6ce32
to
1e6cad7
Compare
there can be one global one for all components, and also custom config for specific components we are also now creating renovate config in json format STONEBLD-2916 Signed-off-by: Robert Cerven <[email protected]>
1e6cad7
to
160da4d
Compare
randomStr1 := RandomString(5) | ||
randomStr2 := RandomString(10) | ||
randomStr3 := RandomString(10) |
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.
Would it be possible to use more descriptive names for these variables?
if globalConfigString != "" || componentConfigString != "" { | ||
if componentConfigString != "" { | ||
configString = componentConfigString | ||
configType = componentConfigType | ||
log.Info("will use custom renovate config for component", "name", componentConfigName, "type", configType) | ||
} else { | ||
configString = globalConfigString | ||
configType = globalConfigType | ||
log.Info("will use custom global renovate config", "name", GlobalRenovateConfigName, "type", configType) | ||
} | ||
|
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 globalConfigString != "" || componentConfigString != "" { | |
if componentConfigString != "" { | |
configString = componentConfigString | |
configType = componentConfigType | |
log.Info("will use custom renovate config for component", "name", componentConfigName, "type", configType) | |
} else { | |
configString = globalConfigString | |
configType = globalConfigType | |
log.Info("will use custom global renovate config", "name", GlobalRenovateConfigName, "type", configType) | |
} | |
if componentConfigString != "" { | |
configString = componentConfigString | |
configType = componentConfigType | |
log.Info("will use custom renovate config for component", "name", componentConfigName, "type", configType) | |
} else if globalConfigString != "" { | |
configString = globalConfigString | |
configType = globalConfigType | |
log.Info("will use custom global renovate config", "name", GlobalRenovateConfigName, "type", configType) |
matchStrings = append(matchStrings, buildResult.BuiltImageRepository+"(:.*)?@(?<currentDigest>sha256:[a-f0-9]+)") | ||
matchPackageNames = append(matchPackageNames, buildResult.BuiltImageRepository) | ||
|
||
for _, drepositiry := range buildResult.DistributionRepositories { |
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.
typo: drepositiry
-> drepository
@@ -245,6 +240,8 @@ var _ = Describe("Component nudge controller", func() { | |||
|
|||
renovatePipelines := getRenovatePipelineRunList() | |||
Expect(len(renovatePipelines)).Should(Equal(1)) | |||
renovateCommand := strings.Join(renovatePipelines[0].Spec.PipelineSpec.Tasks[0].TaskSpec.Steps[0].Command, ";") | |||
Expect(strings.Contains(renovateCommand, `'username':'image_repo_username'`)).Should(BeTrue()) |
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.
fyi there are Gomega matchers like HaveLen()
and replacements for strings
like ContainSubstring()
and HaveSuffix()
which make the Expects a bit easier to read
Expect(renovateCommand).To(ContainSubstring(\'username':'image_repo_username'\`))
customConfigName := fmt.Sprintf("nudging-renovate-config-%s", Operator1) | ||
customConfigMapName1 := types.NamespacedName{Namespace: UserNamespace, Name: customConfigName} | ||
customConfigString := `{"username":"componentconfiguserjs"}` | ||
customConfigMapData := map[string]string{ConfigKeyJs: customConfigString} | ||
createCustomRenovateConfigMap(customConfigMapName1, customConfigMapData) | ||
customConfigName = fmt.Sprintf("nudging-renovate-config-%s", Operator2) | ||
customConfigMapName2 := types.NamespacedName{Namespace: UserNamespace, Name: customConfigName} | ||
createCustomRenovateConfigMap(customConfigMapName2, customConfigMapData) | ||
customConfigType := "js" |
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 test setups are a bit hard to read. Could you separate the ConfigMaps by linebreaks?
there can be one global one for all components, and also custom config for specific components
we are also now creating renovate config in json format
STONEBLD-2916
Checklist:
make test
passes