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

Add More Banner Options to Argocd CR #1605

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions api/v1alpha1/argocd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,10 @@ type Banner struct {
Content string `json:"content"`
// URL defines an optional URL to be used as banner message link
URL string `json:"url,omitempty"`
// Permanent defines if the banner is sticky (permanent) using a boolean
Permanent bool `json:"permanent,omitempty"`
// Position defines the banner's position - top, bottom or both
Position string `json:"position,omitempty"`
}

// ArgoCDTLSSpec defines the TLS options for ArgCD.
Expand Down
10 changes: 10 additions & 0 deletions bundle/manifests/argoproj.io_argocds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@ spec:
description: URL defines an optional URL to be used as banner
message link
type: string
permanent:
description: Permanent defines if the banner is sticky (permanent) using a boolean
type: boolean
position:
description: Position defines the banner's position - top, bottom or both
enum:
- top
- bottom
- both
type: string
required:
- content
type: object
Expand Down
6 changes: 6 additions & 0 deletions common/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ const (
// ArgoCDKeyBannerURL is the configuration key for a banner message URL.
ArgoCDKeyBannerURL = "ui.bannerurl"

// ArgoCDKeyBannerPermanent is the configuration key for whether a banner message is permanent.
ArgoCDKeyBannerPermanent = "ui.bannerpermanent"

// ArgoCDKeyBannerPosition is the configuration key for a banner message position.
ArgoCDKeyBannerPosition = "ui.bannerposition"

// ArgoCDKeyTLSCACert is the key for TLS CA certificates.
ArgoCDKeyTLSCACert = "ca.crt"

Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/argoproj.io_argocds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,16 @@ spec:
description: URL defines an optional URL to be used as banner
message link
type: string
permanent:
description: Permanent defines if the banner is sticky (permanent) using a boolean
type: boolean
position:
description: Position defines the banner's position - top, bottom or both
enum:
- top
- bottom
- both
type: string
required:
- content
type: object
Expand Down
6 changes: 6 additions & 0 deletions controllers/argocd/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ func (r *ReconcileArgoCD) reconcileArgoConfigMap(cr *argoproj.ArgoCD) error {
if cr.Spec.Banner.URL != "" {
cm.Data[common.ArgoCDKeyBannerURL] = cr.Spec.Banner.URL
}
if cr.Spec.Banner.Permanent != "" {
cm.Data[common.ArgoCDKeyBannerPermanent] = cr.Spec.Banner.Permanent
}
if cr.Spec.Banner.Position != "" {
cm.Data[common.ArgoCDKeyBannerPosition] = cr.Spec.Banner.Position
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions deploy/olm-catalog/argocd-operator/0.13.0/argoproj.io_argocds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,16 @@ spec:
description: URL defines an optional URL to be used as banner
message link
type: string
permanent:
description: Permanent defines if the banner is sticky (permanent) using a boolean
type: boolean
position:
description: Position defines the banner's position - top, bottom or both
enum:
- top
- bottom
- both
type: string
required:
- content
type: object
Expand Down
6 changes: 5 additions & 1 deletion docs/reference/argocd.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Name | Default | Description
--- | --- | ---
[**ApplicationInstanceLabelKey**](#application-instance-label-key) | `mycompany.com/appname` | The metadata.label key name where Argo CD injects the app name as a tracking label.
[**ApplicationSet**](#applicationset-controller-options) | [Object] | ApplicationSet controller configuration options.
[**Banner**](#banner) | [Object] | Add a UI banner message.
[**ConfigManagementPlugins**](#config-management-plugins) | [Empty] | Configuration to add a config management plugin.
[**Controller**](#controller-options) | [Object] | Argo CD Application Controller options.
[**DisableAdmin**](#disable-admin) | `false` | Disable the admin user.
Expand Down Expand Up @@ -48,7 +49,6 @@ Name | Default | Description
[**TLS**](#tls-options) | [Object] | TLS configuration options.
[**UsersAnonymousEnabled**](#users-anonymous-enabled) | `true` | Enable anonymous user access.
[**Version**](#version) | v2.4.0 (SHA) | The tag to use with the container image for all Argo CD components.
[**Banner**](#banner) | [Object] | Add a UI banner message.

## Application Instance Label Key

Expand Down Expand Up @@ -1773,6 +1773,8 @@ Name | Default | Description
--- | --- | ---
Banner.Content | [Empty] | The banner message content (required if a banner should be displayed).
Banner.URL | [Empty] | The banner message link URL (optional).
Banner.Permanent | false | Defines if the banner is sticky (permanent)
Banner.position | "top" | The banner massage's position "top", "both" or "bottom"

### Banner Example
The following example enables a UI banner with message content and URL.
Expand All @@ -1788,4 +1790,6 @@ spec:
banner:
content: "Custom Styles - Banners"
url: "https://argo-cd.readthedocs.io/en/stable/operator-manual/custom-styles/#banners"
permanent: true
position: "both"
```
Loading