Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,14 @@ func Pod(source *operatorsv1alpha1.CatalogSource, name, opmImg, utilImage, img s

pod.Spec.Containers[0].Image = opmImg
pod.Spec.Containers[0].Command = []string{"/bin/opm"}
// set service cache dir unconditionally, since it should always have compatible permissions for generation, if not provided by grpcPodConfig
pod.Spec.Containers[0].Args = []string{
var containerArgs = []string{
"serve",
filepath.Join(catalogPath, "catalog"),
"--cache-dir=" + filepath.Join(catalogPath, "cache"),
}
if grpcPodConfig.ExtractContent.CacheDir != "" {
containerArgs = append(containerArgs, "--cache-dir="+filepath.Join(catalogPath, "cache"))
}
pod.Spec.Containers[0].Args = containerArgs
pod.Spec.Containers[0].VolumeMounts = append(pod.Spec.Containers[0].VolumeMounts, contentVolumeMount)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func TestPodExtractContent(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
GenerateName: "test-",
Namespace: "testns",
Labels: map[string]string{"olm.pod-spec-hash": "b0yrMl85J8bFjFWNl1O2XxsX698iPAjbpNhRIT", "olm.managed": "true"},
Labels: map[string]string{"olm.pod-spec-hash": "b4ns9MTvaRBYOarmuFe6PLYK0r2kxj5Vo06WTU", "olm.managed": "true"},
Annotations: map[string]string{"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"},
},
Spec: corev1.PodSpec{
Expand Down Expand Up @@ -444,7 +444,7 @@ func TestPodExtractContent(t *testing.T) {
Name: "name",
Image: "opmImage",
Command: []string{"/bin/opm"},
Args: []string{"serve", "/extracted-catalog/catalog", "--cache-dir=/extracted-catalog/cache"},
Args: []string{"serve", "/extracted-catalog/catalog"},
Ports: []corev1.ContainerPort{{Name: "grpc", ContainerPort: 50051}},
ReadinessProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
Expand Down Expand Up @@ -719,7 +719,7 @@ func TestPodExtractContent(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
GenerateName: "test-",
Namespace: "testns",
Labels: map[string]string{"olm.pod-spec-hash": "3qxzUcTKDfq8QwZPoXteAv35FSwRho7vyYkv4d", "olm.managed": "true"},
Labels: map[string]string{"olm.pod-spec-hash": "cO4moUo3vz6jZlcoBcxY4BB8o8a4E7m5GXCzI", "olm.managed": "true"},
Annotations: map[string]string{"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"},
},
Spec: corev1.PodSpec{
Expand Down Expand Up @@ -771,7 +771,7 @@ func TestPodExtractContent(t *testing.T) {
Name: "name",
Image: "opmImage",
Command: []string{"/bin/opm"},
Args: []string{"serve", "/extracted-catalog/catalog", "--cache-dir=/extracted-catalog/cache"},
Args: []string{"serve", "/extracted-catalog/catalog"},
Ports: []corev1.ContainerPort{{Name: "grpc", ContainerPort: 50051}},
ReadinessProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.