Skip to content

Commit

Permalink
ImagePullPolicy updated in install.go
Browse files Browse the repository at this point in the history
Signed-off-by: rootxrishabh <risrock02@gmail.com>
  • Loading branch information
rootxrishabh committed May 26, 2023
1 parent bea659a commit 89917b4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ func K8sInstaller(c *k8s.Client, o Options) error {
}

relayDeployment := deployments.GetRelayDeployment(o.Namespace)
if o.Local {
relayDeployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = "IfNotPresent"
}
if !o.Save {
printMessage("🛰 KubeArmor Relay Deployment ", true)
if _, err := c.K8sClientset.AppsV1().Deployments(o.Namespace).Create(context.Background(), relayDeployment, metav1.CreateOptions{}); err != nil {
Expand Down Expand Up @@ -327,6 +330,10 @@ func K8sInstaller(c *k8s.Client, o Options) error {
}

policyManagerDeployment := deployments.GetPolicyManagerDeployment(o.Namespace)
if o.Local {
policyManagerDeployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = "IfNotPresent"
policyManagerDeployment.Spec.Template.Spec.Containers[1].ImagePullPolicy = "IfNotPresent"
}
if !o.Save {
printMessage("🤖 KubeArmor Policy Manager Deployment ", true)
if _, err := c.K8sClientset.AppsV1().Deployments(o.Namespace).Create(context.Background(), policyManagerDeployment, metav1.CreateOptions{}); err != nil {
Expand All @@ -353,6 +360,10 @@ func K8sInstaller(c *k8s.Client, o Options) error {
}

hostPolicyManagerDeployment := deployments.GetHostPolicyManagerDeployment(o.Namespace)
if o.Local {
hostPolicyManagerDeployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = "IfNotPresent"
hostPolicyManagerDeployment.Spec.Template.Spec.Containers[1].ImagePullPolicy = "IfNotPresent"
}
if !o.Save {
printMessage("🛡 KubeArmor Host Policy Manager Deployment ", true)
if _, err := c.K8sClientset.AppsV1().Deployments(o.Namespace).Create(context.Background(), hostPolicyManagerDeployment, metav1.CreateOptions{}); err != nil {
Expand Down Expand Up @@ -384,6 +395,10 @@ func K8sInstaller(c *k8s.Client, o Options) error {
}

annotationsControllerDeployment := deployments.GetAnnotationsControllerDeployment(o.Namespace)
if o.Local {
annotationsControllerDeployment.Spec.Template.Spec.Containers[0].ImagePullPolicy = "IfNotPresent"
annotationsControllerDeployment.Spec.Template.Spec.Containers[1].ImagePullPolicy = "IfNotPresent"
}
if !o.Save {
printMessage("🚀 KubeArmor Annotation Controller Deployment ", true)
if _, err := c.K8sClientset.AppsV1().Deployments(o.Namespace).Create(context.Background(), annotationsControllerDeployment, metav1.CreateOptions{}); err != nil {
Expand Down

0 comments on commit 89917b4

Please sign in to comment.