Skip to content

Commit

Permalink
review comments and fixes
Browse files Browse the repository at this point in the history
Signed-off-by: saumeya <saumeyakatyal@gmail.com>
  • Loading branch information
saumeya committed Oct 10, 2024
1 parent 973a4ad commit 5a056ca
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 35 deletions.
6 changes: 3 additions & 3 deletions api/v1alpha1/argocd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,9 @@ type ArgoCDServerSpec struct {
// Autoscale defines the autoscale options for the Argo CD Server component.
Autoscale ArgoCDServerAutoscaleSpec `json:"autoscale,omitempty"`

// EnableRolloutUI will add the argo rollout UI extension in ArgoCD Dashboard.
EnableRolloutUI bool `json:"enableRolloutUI,omitempty"`

// GRPC defines the state for the Argo CD Server GRPC options.
GRPC ArgoCDServerGRPCSpec `json:"grpc,omitempty"`

Expand Down Expand Up @@ -687,9 +690,6 @@ type ArgoCDSpec struct {
// DisableAdmin will disable the admin user.
DisableAdmin bool `json:"disableAdmin,omitempty"`

// EnableArgoRolloutUI will add the argo rollout UI extension in ArgoCD Dashboard.
EnableArgoRolloutUI bool `json:"enableArgoRolloutUI,omitempty"`

// ExtraConfig can be used to add fields to Argo CD configmap that are not supported by Argo CD CRD.
//
// Note: ExtraConfig takes precedence over Argo CD CRD.
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/argocd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ type ArgoCDServerSpec struct {
// Autoscale defines the autoscale options for the Argo CD Server component.
Autoscale ArgoCDServerAutoscaleSpec `json:"autoscale,omitempty"`

// EnableRolloutUI will add the argo rollout UI extension in ArgoCD Dashboard.
EnableRolloutUI bool `json:"enableRolloutUI,omitempty"`

// GRPC defines the state for the Argo CD Server GRPC options.
GRPC ArgoCDServerGRPCSpec `json:"grpc,omitempty"`

Expand Down Expand Up @@ -788,9 +791,6 @@ type ArgoCDSpec struct {
// DisableAdmin will disable the admin user.
DisableAdmin bool `json:"disableAdmin,omitempty"`

// EnableArgoRolloutUI will add the argo rollout UI extension in ArgoCD Dashboard.
EnableArgoRolloutUI bool `json:"enableArgoRolloutUI,omitempty"`

// ExtraConfig can be used to add fields to Argo CD configmap that are not supported by Argo CD CRD.
//
// Note: ExtraConfig takes precedence over Argo CD CRD.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ metadata:
capabilities: Deep Insights
categories: Integration & Delivery
certified: "false"
createdAt: "2024-10-03T11:13:43Z"
createdAt: "2024-10-10T12:00:44Z"
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
operators.operatorframework.io/builder: operator-sdk-v1.35.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
Expand Down
16 changes: 8 additions & 8 deletions bundle/manifests/argoproj.io_argocds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,6 @@ spec:
disableAdmin:
description: DisableAdmin will disable the admin user.
type: boolean
enableArgoRolloutUI:
description: EnableArgoRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
extraConfig:
additionalProperties:
type: string
Expand Down Expand Up @@ -6425,6 +6421,10 @@ spec:
required:
- enabled
type: object
enableRolloutUI:
description: EnableRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
env:
description: Env lets you specify environment for API server pods
items:
Expand Down Expand Up @@ -12259,10 +12259,6 @@ spec:
disableAdmin:
description: DisableAdmin will disable the admin user.
type: boolean
enableArgoRolloutUI:
description: EnableArgoRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
extraConfig:
additionalProperties:
type: string
Expand Down Expand Up @@ -17926,6 +17922,10 @@ spec:
required:
- enabled
type: object
enableRolloutUI:
description: EnableRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
enabled:
description: Enabled is the flag to enable ArgoCD Server during
ArgoCD installation. (optional, default `true`)
Expand Down
16 changes: 8 additions & 8 deletions config/crd/bases/argoproj.io_argocds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,6 @@ spec:
disableAdmin:
description: DisableAdmin will disable the admin user.
type: boolean
enableArgoRolloutUI:
description: EnableArgoRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
extraConfig:
additionalProperties:
type: string
Expand Down Expand Up @@ -6414,6 +6410,10 @@ spec:
required:
- enabled
type: object
enableRolloutUI:
description: EnableRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
env:
description: Env lets you specify environment for API server pods
items:
Expand Down Expand Up @@ -12248,10 +12248,6 @@ spec:
disableAdmin:
description: DisableAdmin will disable the admin user.
type: boolean
enableArgoRolloutUI:
description: EnableArgoRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
extraConfig:
additionalProperties:
type: string
Expand Down Expand Up @@ -17915,6 +17911,10 @@ spec:
required:
- enabled
type: object
enableRolloutUI:
description: EnableRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
enabled:
description: Enabled is the flag to enable ArgoCD Server during
ArgoCD installation. (optional, default `true`)
Expand Down
17 changes: 14 additions & 3 deletions controllers/argocd/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ func (r *ReconcileArgoCD) reconcileServerDeployment(cr *argoproj.ArgoCD, useTLSF

deploy.Spec.Template.Spec.Volumes = serverVolumes

if cr.Spec.EnableArgoRolloutUI {
if cr.Spec.Server.EnableRolloutUI {

deploy.Spec.Template.Spec.InitContainers = append(deploy.Spec.Template.Spec.InitContainers, getRolloutInitContainer()...)

Expand All @@ -1389,7 +1389,7 @@ func (r *ReconcileArgoCD) reconcileServerDeployment(cr *argoproj.ArgoCD, useTLSF
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
})
} else if !cr.Spec.EnableArgoRolloutUI {
} else if !cr.Spec.Server.EnableRolloutUI {
deploy.Spec.Template.Spec.InitContainers = removeInitContainer(deploy.Spec.Template.Spec.InitContainers, "rollout-extension")
deploy.Spec.Template.Spec.Volumes = removeVolume(deploy.Spec.Template.Spec.Volumes, "extensions")
deploy.Spec.Template.Spec.Containers[0].VolumeMounts = removeVolumeMount(deploy.Spec.Template.Spec.Containers[0].VolumeMounts, "extensions")
Expand All @@ -1411,7 +1411,9 @@ func (r *ReconcileArgoCD) reconcileServerDeployment(cr *argoproj.ArgoCD, useTLSF
if cr.Spec.Server.Labels != nil {
for key, value := range cr.Spec.Server.Labels {
deploy.Spec.Template.Labels[key] = value

}
}
if err := applyReconcilerHook(cr, deploy, ""); err != nil {
return err
}
Expand Down Expand Up @@ -1580,8 +1582,17 @@ func getRolloutInitContainer() []corev1.Container {
},
},
SecurityContext: &corev1.SecurityContext{
RunAsUser: int64Ptr(1000),
AllowPrivilegeEscalation: boolPtr(false),
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{
"ALL",
},
},
RunAsNonRoot: boolPtr(true),
RunAsUser: int64Ptr(999),
SeccompProfile: &corev1.SeccompProfile{
Type: "RuntimeDefault",
},
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ metadata:
capabilities: Deep Insights
categories: Integration & Delivery
certified: "false"
createdAt: "2024-10-03T11:13:43Z"
createdAt: "2024-10-10T12:00:44Z"
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
operators.operatorframework.io/builder: operator-sdk-v1.35.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,6 @@ spec:
disableAdmin:
description: DisableAdmin will disable the admin user.
type: boolean
enableArgoRolloutUI:
description: EnableArgoRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
extraConfig:
additionalProperties:
type: string
Expand Down Expand Up @@ -6425,6 +6421,10 @@ spec:
required:
- enabled
type: object
enableRolloutUI:
description: EnableRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
env:
description: Env lets you specify environment for API server pods
items:
Expand Down Expand Up @@ -12259,10 +12259,6 @@ spec:
disableAdmin:
description: DisableAdmin will disable the admin user.
type: boolean
enableArgoRolloutUI:
description: EnableArgoRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
extraConfig:
additionalProperties:
type: string
Expand Down Expand Up @@ -17926,6 +17922,10 @@ spec:
required:
- enabled
type: object
enableRolloutUI:
description: EnableRolloutUI will add the argo rollout UI extension
in ArgoCD Dashboard.
type: boolean
enabled:
description: Enabled is the flag to enable ArgoCD Server during
ArgoCD installation. (optional, default `true`)
Expand Down

0 comments on commit 5a056ca

Please sign in to comment.