Skip to content
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

change docker images and push,change images for job #311

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions shardingsphere-operator/build/tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ ENV ZOOKEEPER_VERSION 3.7.1
ENV ZOOKEEPER_DOWNLOAD_URL https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
ENV ZOOKEEPER_DIR /app/zookeeper
WORKDIR /app
COPY start.sh .
RUN chmod +x start.sh
CMD ["./start.sh"]
RUN mkdir -p "/app/start" && chmod -R 777 /app/start
CMD ["tail -f /dev/null"]
ENTRYPOINT ["sh","-c"]
RUN set -eux; \
\
Expand Down
20 changes: 0 additions & 20 deletions shardingsphere-operator/build/tools/start.sh

This file was deleted.

12 changes: 8 additions & 4 deletions shardingsphere-operator/pkg/reconcile/shardingspherechaos/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ import (
const (
DefaultImageName = "agoiyanzsa/tools-runtime:1.0"
DefaultContainerName = "tools-runtime"
DefaultWorkPath = "/app"
DefaultWorkPath = "/app/start"
DefaultConfigName = "cmd-conf"
)

var DefaultFileMode int32 = 493

const (
completions = "jobs.batch/completions"
activeDeadlineSeconds = "jobs.batch/activeDeadlineSeconds"
Expand Down Expand Up @@ -110,6 +112,7 @@ func NewJob(ssChaos *v1alpha1.ShardingSphereChaos, requirement InjectRequirement

v.ConfigMap = &corev1.ConfigMapVolumeSource{}
v.ConfigMap.LocalObjectReference.Name = ssChaos.Name
v.ConfigMap.DefaultMode = &DefaultFileMode
jbd.SetVolumes(v)

vm := &corev1.VolumeMount{Name: DefaultConfigName, MountPath: DefaultWorkPath}
Expand All @@ -118,8 +121,9 @@ func NewJob(ssChaos *v1alpha1.ShardingSphereChaos, requirement InjectRequirement
cbd.SetImage(DefaultImageName)
cbd.SetName(DefaultContainerName)
cbd.SetVolumeMount(vm)
cbd.SetCommand(NewCmds(requirement))
cbd.SetCommand([]string{"sh", "-c"})
container := cbd.Build()
container.Args = NewCmds(requirement)
jbd.SetContainers(container)
rjob := jbd.Build()
return rjob, nil
Expand All @@ -128,10 +132,10 @@ func NewJob(ssChaos *v1alpha1.ShardingSphereChaos, requirement InjectRequirement
func NewCmds(requirement InjectRequirement) (cmds []string) {

if requirement == Experimental {
cmds = append(cmds, fmt.Sprintf("./%s", configExperimental))
cmds = append(cmds, fmt.Sprintf("%s/%s", DefaultWorkPath, configExperimental))
}
if requirement == Pressure {
cmds = append(cmds, fmt.Sprintf("./%s", configExperimental), fmt.Sprintf("./%s", configPressure))
cmds = append(cmds, fmt.Sprintf("%s/%s", DefaultWorkPath, configExperimental), fmt.Sprintf("%s/%s", DefaultWorkPath, configPressure))
}
return
}
Expand Down