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
24 changes: 24 additions & 0 deletions api/core/v1beta1/site_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ type InternalPackageManagerSpec struct {

ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

// Command overrides the container's entrypoint command. If unset (along with Args),
// defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
// backwards compatibility with existing deployments.
// +optional
Command []string `json:"command,omitempty"`

// Args overrides the container's command arguments. If unset (along with Command),
// defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
// backwards compatibility with existing deployments.
// +optional
Args []string `json:"args,omitempty"`

S3Bucket string `json:"s3Bucket,omitempty"`

Replicas int `json:"replicas,omitempty"`
Expand Down Expand Up @@ -307,6 +319,18 @@ type InternalConnectSpec struct {

ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

// Command overrides the container's entrypoint command. If unset (along with Args),
// defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
// backwards compatibility with existing deployments.
// +optional
Command []string `json:"command,omitempty"`

// Args overrides the container's command arguments. If unset (along with Command),
// defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
// backwards compatibility with existing deployments.
// +optional
Args []string `json:"args,omitempty"`

Databricks *DatabricksConfig `json:"databricks,omitempty"`

LoggedInWarning string `json:"loggedInWarning,omitempty"`
Expand Down
20 changes: 20 additions & 0 deletions api/core/v1beta1/zz_generated.deepcopy.go

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

22 changes: 22 additions & 0 deletions client-go/applyconfiguration/core/v1beta1/internalconnectspec.go

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

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

32 changes: 32 additions & 0 deletions config/crd/bases/core.posit.team_sites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ spec:
- rVersion
type: object
type: array
args:
description: |-
Args overrides the container's command arguments. If unset (along with Command),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
auth:
properties:
administratorRoleMapping:
Expand Down Expand Up @@ -259,6 +267,14 @@ spec:
BaseDomain overrides site.Spec.Domain for this product's URL construction.
When set, the product URL will be: domainPrefix.baseDomain
type: string
command:
description: |-
Command overrides the container's entrypoint command. If unset (along with Args),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
databaseSettings:
properties:
instrumentationSchema:
Expand Down Expand Up @@ -941,6 +957,14 @@ spec:
description: AdditionalConfig allows appending arbitrary gcfg
config content to the generated config.
type: string
args:
description: |-
Args overrides the container's command arguments. If unset (along with Command),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
auth:
description: Auth configures OIDC authentication for Package Manager's
web UI
Expand Down Expand Up @@ -1012,6 +1036,14 @@ spec:
BaseDomain overrides site.Spec.Domain for this product's URL construction.
When set, the product URL will be: domainPrefix.baseDomain
type: string
command:
description: |-
Command overrides the container's entrypoint command. If unset (along with Args),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
domainPrefix:
default: packagemanager
type: string
Expand Down
32 changes: 32 additions & 0 deletions dist/chart/templates/crd/core.posit.team_sites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ spec:
- rVersion
type: object
type: array
args:
description: |-
Args overrides the container's command arguments. If unset (along with Command),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
auth:
properties:
administratorRoleMapping:
Expand Down Expand Up @@ -280,6 +288,14 @@ spec:
BaseDomain overrides site.Spec.Domain for this product's URL construction.
When set, the product URL will be: domainPrefix.baseDomain
type: string
command:
description: |-
Command overrides the container's entrypoint command. If unset (along with Args),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
databaseSettings:
properties:
instrumentationSchema:
Expand Down Expand Up @@ -962,6 +978,14 @@ spec:
description: AdditionalConfig allows appending arbitrary gcfg
config content to the generated config.
type: string
args:
description: |-
Args overrides the container's command arguments. If unset (along with Command),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
auth:
description: Auth configures OIDC authentication for Package Manager's
web UI
Expand Down Expand Up @@ -1033,6 +1057,14 @@ spec:
BaseDomain overrides site.Spec.Domain for this product's URL construction.
When set, the product URL will be: domainPrefix.baseDomain
type: string
command:
description: |-
Command overrides the container's entrypoint command. If unset (along with Args),
defaults to the historical "tini -- /usr/local/bin/startup.sh" wrapper for
backwards compatibility with existing deployments.
items:
type: string
type: array
domainPrefix:
default: packagemanager
type: string
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/core/site_controller_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ func (r *SiteReconciler) reconcileConnect(
Image: site.Spec.Connect.Image,
SessionImage: site.Spec.Connect.SessionImage,
ImagePullPolicy: site.Spec.Connect.ImagePullPolicy,
Command: site.Spec.Connect.Command,
Args: site.Spec.Connect.Args,
ImagePullSecrets: site.Spec.ImagePullSecrets,
ChronicleAgentImage: site.Spec.Chronicle.AgentImage,
AdditionalVolumes: additionalVolumes,
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/core/site_controller_package_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ func (r *SiteReconciler) reconcilePackageManager(
IngressAnnotations: site.Spec.IngressAnnotations,
Image: site.Spec.PackageManager.Image,
ImagePullPolicy: site.Spec.PackageManager.ImagePullPolicy,
Command: site.Spec.PackageManager.Command,
Args: site.Spec.PackageManager.Args,
ImagePullSecrets: site.Spec.ImagePullSecrets,
ChronicleAgentImage: site.Spec.Chronicle.AgentImage,
NodeSelector: site.Spec.PackageManager.NodeSelector,
Expand Down
56 changes: 56 additions & 0 deletions internal/controller/core/site_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,62 @@ func TestSiteReconciler_RegisterOnFirstLoginDefaultNil(t *testing.T) {
assert.Nil(t, testConnect.Spec.RegisterOnFirstLogin)
}

func TestSiteReconciler_ConnectCommandArgsPropagation(t *testing.T) {
siteName := "connect-command-args"
siteNamespace := "posit-team"
site := defaultSite(siteName)
site.Spec.Connect.Command = []string{"/usr/local/bin/startup.sh"}
site.Spec.Connect.Args = []string{"--foo"}

cli, _, err := runFakeSiteReconciler(t, siteNamespace, siteName, site)
assert.Nil(t, err)

testConnect := getConnect(t, cli, siteNamespace, siteName)
assert.Equal(t, []string{"/usr/local/bin/startup.sh"}, testConnect.Spec.Command)
assert.Equal(t, []string{"--foo"}, testConnect.Spec.Args)
}

func TestSiteReconciler_ConnectCommandArgsDefaultNil(t *testing.T) {
siteName := "connect-command-args-default"
siteNamespace := "posit-team"
site := defaultSite(siteName)

cli, _, err := runFakeSiteReconciler(t, siteNamespace, siteName, site)
assert.Nil(t, err)

testConnect := getConnect(t, cli, siteNamespace, siteName)
assert.Nil(t, testConnect.Spec.Command)
assert.Nil(t, testConnect.Spec.Args)
}

func TestSiteReconciler_PackageManagerCommandArgsPropagation(t *testing.T) {
siteName := "packagemanager-command-args"
siteNamespace := "posit-team"
site := defaultSite(siteName)
site.Spec.PackageManager.Command = []string{"/usr/local/bin/startup.sh"}
site.Spec.PackageManager.Args = []string{"--foo"}

cli, _, err := runFakeSiteReconciler(t, siteNamespace, siteName, site)
assert.Nil(t, err)

testPackageManager := getPackageManager(t, cli, siteNamespace, siteName)
assert.Equal(t, []string{"/usr/local/bin/startup.sh"}, testPackageManager.Spec.Command)
assert.Equal(t, []string{"--foo"}, testPackageManager.Spec.Args)
}

func TestSiteReconciler_PackageManagerCommandArgsDefaultNil(t *testing.T) {
siteName := "packagemanager-command-args-default"
siteNamespace := "posit-team"
site := defaultSite(siteName)

cli, _, err := runFakeSiteReconciler(t, siteNamespace, siteName, site)
assert.Nil(t, err)

testPackageManager := getPackageManager(t, cli, siteNamespace, siteName)
assert.Nil(t, testPackageManager.Spec.Command)
assert.Nil(t, testPackageManager.Spec.Args)
}

func TestSiteReconciler_BaseDomainNotSet(t *testing.T) {
siteName := "base-domain-not-set"
siteNamespace := "posit-team"
Expand Down
Loading
Loading