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
32 changes: 10 additions & 22 deletions pkg/render/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ type APIServerConfiguration struct {

type apiServerComponent struct {
cfg *APIServerConfiguration
apiServerImage string
queryServerImage string
l7AdmissionControllerImage string
calicoImage string
l7AdmissionControllerEnvoyImage string
dikastesImage string
}
Expand All @@ -170,30 +168,20 @@ func (c *apiServerComponent) ResolveImages(is *operatorv1.ImageSet) error {

enterprise := c.cfg.Installation.Variant.IsEnterprise()
if enterprise || c.cfg.RequiresAggregationServer {
c.apiServerImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
}

if enterprise {
c.queryServerImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if enterprise && c.cfg.IsSidecarInjectionEnabled() {
c.l7AdmissionControllerEnvoyImage, err = components.GetReference(components.ComponentEnvoyProxy, reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
if c.cfg.IsSidecarInjectionEnabled() {
c.l7AdmissionControllerImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
c.l7AdmissionControllerEnvoyImage, err = components.GetReference(components.ComponentEnvoyProxy, reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
c.dikastesImage, err = components.GetReference(components.ComponentDikastes, reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
c.dikastesImage, err = components.GetReference(components.ComponentDikastes, reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
}

Expand Down Expand Up @@ -1177,7 +1165,7 @@ func (c *apiServerComponent) apiServerContainer() corev1.Container {

apiServer := corev1.Container{
Name: string(APIServerContainerName),
Image: c.apiServerImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "apiserver"},
Args: c.startUpArgs(),
Env: env,
Expand Down Expand Up @@ -1317,7 +1305,7 @@ func (c *apiServerComponent) queryServerContainer() corev1.Container {

container := corev1.Container{
Name: string(TigeraAPIServerQueryServerContainerName),
Image: c.queryServerImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "queryserver"},
Env: env,
LivenessProbe: &corev1.Probe{
Expand Down Expand Up @@ -2304,7 +2292,7 @@ func (c *apiServerComponent) l7AdmissionControllerContainer() corev1.Container {

l7AdmssCtrl := corev1.Container{
Name: string(L7AdmissionControllerContainerName),
Image: c.l7AdmissionControllerImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "l7-admission-controller"},
Env: []corev1.EnvVar{
{
Expand Down
6 changes: 3 additions & 3 deletions pkg/render/applicationlayer/applicationlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type Config struct {

// Calculated internal fields.
proxyImage string
collectorImage string
calicoImage string
dikastesImage string
dikastesEnabled bool
perHostEnvoyEnabled bool
Expand Down Expand Up @@ -132,7 +132,7 @@ func (c *component) ResolveImages(is *operatorv1.ImageSet) error {
errMsgs = append(errMsgs, err.Error())
}

c.config.collectorImage, err = components.GetReference(components.CombinedCalicoImage(c.config.Installation), reg, path, prefix, is)
c.config.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.config.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
Expand Down Expand Up @@ -288,7 +288,7 @@ func (c *component) containers() []corev1.Container {
// Log collection specific container
collector := corev1.Container{
Name: L7CollectorContainerName,
Image: c.config.collectorImage,
Image: c.config.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "l7-collector"},
Env: c.collectorEnv(),
SecurityContext: securitycontext.NewRootContext(false),
Expand Down
32 changes: 7 additions & 25 deletions pkg/render/compliance.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,40 +122,22 @@ type ComplianceConfiguration struct {
type complianceComponent struct {
cfg *ComplianceConfiguration
benchmarkerImage string
snapshotterImage string
serverImage string
controllerImage string
reporterImage string
calicoImage string
}

func (c *complianceComponent) ResolveImages(is *operatorv1.ImageSet) error {
reg := c.cfg.Installation.Registry
path := c.cfg.Installation.ImagePath
prefix := c.cfg.Installation.ImagePrefix
var err error
c.benchmarkerImage, err = components.GetReference(components.ComponentComplianceBenchmarker, reg, path, prefix, is)

errMsgs := []string{}
if err != nil {
errMsgs = append(errMsgs, err.Error())
}

c.snapshotterImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}

c.serverImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}

c.controllerImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.benchmarkerImage, err = components.GetReference(components.ComponentComplianceBenchmarker, reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}

c.reporterImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
Expand Down Expand Up @@ -484,7 +466,7 @@ func (c *complianceComponent) complianceControllerDeployment() *appsv1.Deploymen
Containers: []corev1.Container{
{
Name: ComplianceControllerName,
Image: c.controllerImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "compliance-controller"},
Env: envVars,
LivenessProbe: &corev1.Probe{
Expand Down Expand Up @@ -684,7 +666,7 @@ func (c *complianceComponent) complianceReporterPodTemplate() *corev1.PodTemplat
Containers: []corev1.Container{
{
Name: "reporter",
Image: c.reporterImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "compliance-reporter"},
Env: envVars,
LivenessProbe: &corev1.Probe{
Expand Down Expand Up @@ -892,7 +874,7 @@ func (c *complianceComponent) complianceServerDeployment() *appsv1.Deployment {
Containers: []corev1.Container{
{
Name: ComplianceServerName,
Image: c.serverImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "compliance-server"},
Env: envVars,
LivenessProbe: &corev1.Probe{
Expand Down Expand Up @@ -1105,7 +1087,7 @@ func (c *complianceComponent) complianceSnapshotterDeployment() *appsv1.Deployme
Containers: []corev1.Container{
{
Name: ComplianceSnapshotterName,
Image: c.snapshotterImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "compliance-snapshotter"},
Env: envVars,
LivenessProbe: &corev1.Probe{
Expand Down
10 changes: 4 additions & 6 deletions pkg/render/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ type CSIConfiguration struct {
type csiComponent struct {
cfg *CSIConfiguration

csiImage string
csiRegistrarImage string
calicoImage string
}

func CSI(cfg *CSIConfiguration) Component {
Expand Down Expand Up @@ -140,7 +139,7 @@ func (c *csiComponent) csiContainers() []corev1.Container {
mountPropagation := corev1.MountPropagationBidirectional
csiContainer := corev1.Container{
Name: CSIContainerName,
Image: c.csiImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "csi"},
Args: []string{
"--nodeid=$(KUBE_NODE_NAME)",
Expand Down Expand Up @@ -181,7 +180,7 @@ func (c *csiComponent) csiContainers() []corev1.Container {
// Construct "csi-node-driver-registrar" container
registrarContainer := corev1.Container{
Name: CSIRegistrarContainerName,
Image: c.csiRegistrarImage,
Image: c.calicoImage,
Command: []string{"/usr/bin/csi-node-driver-registrar"},
Args: []string{
"--v=5",
Expand Down Expand Up @@ -377,11 +376,10 @@ func (c *csiComponent) ResolveImages(is *operatorv1.ImageSet) error {
path := c.cfg.Installation.ImagePath
prefix := c.cfg.Installation.ImagePrefix
var err error
c.csiImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if err != nil {
return err
}
c.csiRegistrarImage = c.csiImage
return nil
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/render/gatewayapi/gateway_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ type gatewayAPIImplementationComponent struct {
envoyGatewayImage string
envoyProxyImage string
envoyRatelimitImage string
wafHTTPFilterImage string
calicoImage string
L7LogCollectorImage string
}

Expand Down Expand Up @@ -449,7 +449,7 @@ func (pr *gatewayAPIImplementationComponent) ResolveImages(is *operatorv1.ImageS
if err != nil {
return err
}
pr.wafHTTPFilterImage, err = components.GetReference(components.CombinedCalicoImage(pr.cfg.Installation), reg, path, prefix, is)
pr.calicoImage, err = components.GetReference(components.CombinedCalicoImage(pr.cfg.Installation), reg, path, prefix, is)
if err != nil {
return err
}
Expand Down Expand Up @@ -822,7 +822,7 @@ func (pr *gatewayAPIImplementationComponent) envoyProxyConfig(className string,
// Add or update the Init Container to the deployment
wafHTTPFilter := corev1.Container{
Name: wafFilterName,
Image: pr.wafHTTPFilterImage,
Image: pr.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "waf-http-filter"},
Args: []string{
"--logFileDirectory",
Expand Down
6 changes: 3 additions & 3 deletions pkg/render/goldmane/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type Configuration struct {
type Component struct {
cfg *Configuration

goldmaneImage string
calicoImage string
}

func (c *Component) ResolveImages(is *operatorv1.ImageSet) error {
Expand All @@ -92,7 +92,7 @@ func (c *Component) ResolveImages(is *operatorv1.ImageSet) error {
prefix := c.cfg.Installation.ImagePrefix

var err error
c.goldmaneImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
return err
}

Expand Down Expand Up @@ -234,7 +234,7 @@ func (c *Component) goldmaneContainer() corev1.Container {

return corev1.Container{
Name: GoldmaneContainerName,
Image: c.goldmaneImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "goldmane"},
Env: env,
SecurityContext: securitycontext.NewNonRootContext(),
Expand Down
8 changes: 4 additions & 4 deletions pkg/render/guardian.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ type GuardianConfiguration struct {
}

type GuardianComponent struct {
cfg *GuardianConfiguration
image string
cfg *GuardianConfiguration
calicoImage string
}

func (c *GuardianComponent) ResolveImages(is *operatorv1.ImageSet) error {
reg := c.cfg.Installation.Registry
path := c.cfg.Installation.ImagePath
prefix := c.cfg.Installation.ImagePrefix
var err error
c.image, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
return err
}

Expand Down Expand Up @@ -496,7 +496,7 @@ func (c *GuardianComponent) container() []corev1.Container {
return []corev1.Container{
{
Name: GuardianContainerName,
Image: c.image,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "guardian"},
Env: envVars,
VolumeMounts: c.volumeMounts(),
Expand Down
10 changes: 5 additions & 5 deletions pkg/render/intrusion_detection.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ type IntrusionDetectionConfiguration struct {
}

type intrusionDetectionComponent struct {
cfg *IntrusionDetectionConfiguration
controllerImage string
webhooksProcessorImage string
cfg *IntrusionDetectionConfiguration
controllerImage string
calicoImage string
}

func (c *intrusionDetectionComponent) ResolveImages(is *operatorv1.ImageSet) error {
Expand All @@ -137,7 +137,7 @@ func (c *intrusionDetectionComponent) ResolveImages(is *operatorv1.ImageSet) err
errMsgs = append(errMsgs, err.Error())
}

c.webhooksProcessorImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
Expand Down Expand Up @@ -686,7 +686,7 @@ func (c *intrusionDetectionComponent) webhooksControllerContainer() corev1.Conta

return corev1.Container{
Name: "webhooks-processor",
Image: c.webhooksProcessorImage,
Image: c.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "webhooks-processor"},
Env: envVars,
SecurityContext: securitycontext.NewNonRootContext(),
Expand Down
6 changes: 3 additions & 3 deletions pkg/render/kubecontrollers/kube-controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ type kubeControllersComponent struct {
cfg *KubeControllersConfiguration

// Internal state generated by the given configuration.
image string
calicoImage string

kubeControllerServiceAccountName string
kubeControllerRoleName string
Expand All @@ -241,7 +241,7 @@ func (c *kubeControllersComponent) ResolveImages(is *operatorv1.ImageSet) error
path := c.cfg.Installation.ImagePath
prefix := c.cfg.Installation.ImagePrefix
var err error
c.image, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
c.calicoImage, err = components.GetReference(components.CombinedCalicoImage(c.cfg.Installation), reg, path, prefix, is)
return err
}

Expand Down Expand Up @@ -618,7 +618,7 @@ func (c *kubeControllersComponent) controllersDeployment() *appsv1.Deployment {

container := corev1.Container{
Name: c.kubeControllerName,
Image: c.image,
Image: c.calicoImage,
Command: containerCommand,
Env: env,
Resources: c.kubeControllersResources(),
Expand Down
10 changes: 5 additions & 5 deletions pkg/render/logstorage/esgateway/esgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ func EsGateway(c *Config) render.Component {
}

type esGateway struct {
csrImage string
esGatewayImage string
cfg *Config
csrImage string
calicoImage string
cfg *Config
}

// Config contains all the config information needed to render the EsGateway component.
Expand All @@ -92,7 +92,7 @@ func (e *esGateway) ResolveImages(is *operatorv1.ImageSet) error {
var err error
errMsgs := []string{}

e.esGatewayImage, err = components.GetReference(components.CombinedCalicoImage(e.cfg.Installation), reg, path, prefix, is)
e.calicoImage, err = components.GetReference(components.CombinedCalicoImage(e.cfg.Installation), reg, path, prefix, is)
if err != nil {
errMsgs = append(errMsgs, err.Error())
}
Expand Down Expand Up @@ -252,7 +252,7 @@ func (e *esGateway) esGatewayDeployment() *appsv1.Deployment {
Containers: []corev1.Container{
{
Name: DeploymentName,
Image: e.esGatewayImage,
Image: e.calicoImage,
Command: []string{components.CalicoBinaryPath, "component", "es-gateway"},
Env: envVars,
VolumeMounts: volumeMounts,
Expand Down
Loading
Loading