-
Notifications
You must be signed in to change notification settings - Fork 59
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
MON-3468: Add cli args to specify image pullspecs and versions for operants #386
MON-3468: Add cli args to specify image pullspecs and versions for operants #386
Conversation
Skipping CI for Draft Pull Request. |
5c8669b
to
f8ec622
Compare
f8ec622
to
8bde370
Compare
Updated with |
8bde370
to
61da795
Compare
dccb879
to
af2046d
Compare
@jan--f: This pull request references MON-3468 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.15.0" version, but no target version was set. In response to this:
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. |
cmd/operator/main.go
Outdated
images := kvarg{} | ||
flag.Var(&images, "images", "Images to use for containers managed by the observability-operator.") | ||
versions := kvarg{} | ||
flag.Var(&versions, "versions", "Version of containers managed by the observability-operator.") |
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.
Do we need to define the operand versions or should we rely on the hardcoded default versions from github.com/rhobs/obo-prometheus-operator?
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.
I was going to argue for the p-o default versions. In the Thanos Querier controller I already set that explicitly https://github.com/rhobs/observability-operator/pull/386/files#diff-62df723ef5f27edbbfaa7feeb8a0612efaa9ef8d91828004287a17f77f0c48aeR74. In Prometheus
objects the version is not set if empty to let p-o do its defaulting.
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.
Defaulting would be latest or does p-o do any kind of logic already?
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.
IMHO it makes more sense for p-o and thanos do their defaults
map[string]float64{ | ||
`{__name__="controller_runtime_reconcile_errors_total", controller="grafana-operator"}`: 0, |
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.
I assume we're removing this as a part of the change as grafana-operator is no longer around in p-o
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 I've stumbled across https://pkg.go.dev/k8s.io/[email protected]/cli/flag#MapStringString which can translate key=val
CLI args into map[string]string.
Nice, thank you! Added. |
af2046d
to
a2dee86
Compare
3f0baf2
to
a4d5ccc
Compare
Signed-off-by: Jan Fajerski <[email protected]>
Signed-off-by: Jan Fajerski <[email protected]>
Signed-off-by: Jan Fajerski <[email protected]>
This commit also decouples the monitoring-stack controller and thanos controller by implementing a ThanosSidecar configuration struct in monitoring-stack. Signed-off-by: Jan Fajerski <[email protected]>
a4d5ccc
to
8096284
Compare
8096284
to
b301231
Compare
hmmmm e2e tests are complaining about |
/test observability-operator-e2e |
/assign @sthaha |
b301231
to
300696d
Compare
And add some default checking and setting. Signed-off-by: Jan Fajerski <[email protected]>
300696d
to
c6b064c
Compare
Signed-off-by: Jan Fajerski <[email protected]>
eb4c6c8
to
c3ff294
Compare
cmd/operator/main.go
Outdated
// error. | ||
func validateImages(images *k8sflag.MapStringString) (map[string]string, error) { | ||
res := defaultImages | ||
if !images.Empty() { |
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.
(nit) fast path if no custom images are provided
if !images.Empty() { | |
if images.Empty() { | |
return res | |
} |
cmd/operator/main.go
Outdated
imgs := *images.Map | ||
for k, v := range imgs { | ||
if _, ok := res[k]; !ok { | ||
return nil, fmt.Errorf(fmt.Sprintf("image %v is unknown", k)) |
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.
return nil, fmt.Errorf(fmt.Sprintf("image %v is unknown", k)) | |
return nil, fmt.Errorf("image %v is unknown", k) |
cmd/operator/main.go
Outdated
func imagesUsed() []string { | ||
i := 0 | ||
imgs := make([]string, len(defaultImages)) | ||
for k := range defaultImages { | ||
imgs[i] = k | ||
i++ | ||
} | ||
return imgs | ||
} |
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.
(nit) ensure stable sort
func imagesUsed() []string { | |
i := 0 | |
imgs := make([]string, len(defaultImages)) | |
for k := range defaultImages { | |
imgs[i] = k | |
i++ | |
} | |
return imgs | |
} | |
func imagesUsed() []string { | |
i := 0 | |
imgs := make([]string, len(defaultImages)) | |
for k := range defaultImages { | |
imgs[i] = k | |
i++ | |
} | |
slices.Sortimgs) | |
return imgs | |
} |
Signed-off-by: Jan Fajerski <[email protected]>
c3ff294
to
324db3c
Compare
Signed-off-by: Jan Fajerski <[email protected]>
/lgtm |
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: danielmellado, jan--f 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 |
Fixes #250