-
Notifications
You must be signed in to change notification settings - Fork 124
Make is_ready container-image configurable #2593
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -37,6 +37,7 @@ const ( | |||||
elasticsearchImageName = "docker.elastic.co/elasticsearch/elasticsearch" | ||||||
kibanaImageName = "docker.elastic.co/kibana/kibana" | ||||||
logstashImageName = "docker.elastic.co/logstash/logstash" | ||||||
isreadyImageName = "tianon/true:multiarch" | ||||||
|
||||||
applicationConfigurationYmlFile = "config.yml" | ||||||
) | ||||||
|
@@ -101,6 +102,7 @@ func (s stack) ImageRefOverridesForVersion(version string) ImageRefs { | |||||
Elasticsearch: checkImageRefOverride("ELASTICSEARCH_IMAGE_REF_OVERRIDE", stringOrDefault(appConfigImageRefs.Elasticsearch, "")), | ||||||
Kibana: checkImageRefOverride("KIBANA_IMAGE_REF_OVERRIDE", stringOrDefault(appConfigImageRefs.Kibana, "")), | ||||||
Logstash: checkImageRefOverride("LOGSTASH_IMAGE_REF_OVERRIDE", stringOrDefault(appConfigImageRefs.Logstash, "")), | ||||||
is_ready: checkImageRefOverride("IS_READY_IMAGE_REF_OVERRIDE", stringOrDefault(appConfigImageRefs.is_ready, "")), | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -110,6 +112,7 @@ type ImageRefs struct { | |||||
Elasticsearch string `yaml:"elasticsearch"` | ||||||
Kibana string `yaml:"kibana"` | ||||||
Logstash string `yaml:"logstash"` | ||||||
is_ready string `yaml:"is_ready"` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
// AsEnv method returns key=value representation of image refs. | ||||||
|
@@ -119,6 +122,7 @@ func (ir ImageRefs) AsEnv() []string { | |||||
vars = append(vars, "ELASTICSEARCH_IMAGE_REF="+ir.Elasticsearch) | ||||||
vars = append(vars, "KIBANA_IMAGE_REF="+ir.Kibana) | ||||||
vars = append(vars, "LOGSTASH_IMAGE_REF="+ir.Logstash) | ||||||
vars = append(vars, "IS_READY_IMAGE_REF="+ir.is_ready) | ||||||
return vars | ||||||
} | ||||||
|
||||||
|
@@ -129,6 +133,7 @@ func (ac *ApplicationConfiguration) StackImageRefs() ImageRefs { | |||||
refs.Elasticsearch = stringOrDefault(refs.Elasticsearch, fmt.Sprintf("%s:%s", elasticsearchImageName, ac.stackVersion)) | ||||||
refs.Kibana = stringOrDefault(refs.Kibana, fmt.Sprintf("%s:%s", kibanaImageName, ac.stackVersion)) | ||||||
refs.Logstash = stringOrDefault(refs.Logstash, fmt.Sprintf("%s:%s", logstashImageName, ac.stackVersion)) | ||||||
refs.is_ready = stringOrDefault(refs.is_ready, isreadyImageName) | ||||||
return refs | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please review other compose files in this directory that may be using this image. |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -28,7 +28,7 @@ services: | |||
- "127.0.0.1:9200:9200" | ||||
|
||||
elasticsearch_is_ready: | ||||
image: tianon/true:multiarch | ||||
image: "${IS_READY_IMAGE_REF}" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be updated also the docker-compose for local services ? To use that environment variable, this file uses facts instead. Here it is the method where those facts are set:
|
||||
depends_on: | ||||
elasticsearch: | ||||
condition: service_healthy | ||||
|
@@ -57,7 +57,7 @@ services: | |||
- "127.0.0.1:5601:5601" | ||||
|
||||
kibana_is_ready: | ||||
image: tianon/true:multiarch | ||||
image: "${IS_READY_IMAGE_REF}" | ||||
depends_on: | ||||
kibana: | ||||
condition: service_healthy | ||||
|
@@ -89,7 +89,7 @@ services: | |||
- "127.0.0.1:9000:9000" | ||||
|
||||
package-registry_is_ready: | ||||
image: tianon/true:multiarch | ||||
image: "${IS_READY_IMAGE_REF}" | ||||
depends_on: | ||||
package-registry: | ||||
condition: service_healthy | ||||
|
@@ -130,7 +130,7 @@ services: | |||
{{ end }} | ||||
|
||||
fleet-server_is_ready: | ||||
image: tianon/true:multiarch | ||||
image: "${IS_READY_IMAGE_REF}" | ||||
depends_on: | ||||
fleet-server: | ||||
condition: service_healthy | ||||
|
@@ -162,7 +162,7 @@ services: | |||
target: /run/service_logs/ | ||||
|
||||
elastic-agent_is_ready: | ||||
image: tianon/true:multiarch | ||||
image: "${IS_READY_IMAGE_REF}" | ||||
depends_on: | ||||
elastic-agent: | ||||
condition: service_healthy | ||||
|
@@ -195,7 +195,7 @@ services: | |||
- ELASTIC_HOSTS=https://127.0.0.1:9200 | ||||
|
||||
logstash_is_ready: | ||||
image: tianon/true:multiarch | ||||
image: "${IS_READY_IMAGE_REF}" | ||||
depends_on: | ||||
logstash: | ||||
condition: service_healthy | ||||
|
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.