Skip to content

Commit

Permalink
Remove ConfigOrSecret API, replaced with the newer FileReference (#411)
Browse files Browse the repository at this point in the history
This only impacts SASL config which is not supported product-wise
  • Loading branch information
jotak authored Sep 8, 2023
1 parent 7aa9ff7 commit 623a3b2
Show file tree
Hide file tree
Showing 14 changed files with 398 additions and 190 deletions.
34 changes: 8 additions & 26 deletions api/v1beta1/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,19 +716,19 @@ const (

type FileReference struct {
//+kubebuilder:validation:Enum=configmap;secret
// type for the file reference: "configmap" or "secret"
// Type for the file reference: "configmap" or "secret"
Type MountableType `json:"type,omitempty"`

// name of the config map or secret containing the file
// Name of the config map or secret containing the file
Name string `json:"name,omitempty"`

// namespace of the config map or secret containing the file. If omitted, assumes same namespace as where NetObserv is deployed.
// Namespace of the config map or secret containing the file. If omitted, assumes same namespace as where NetObserv is deployed.
// If the namespace is different, the config map or the secret will be copied so that it can be mounted as required.
// +optional
//+kubebuilder:default:=""
Namespace string `json:"namespace,omitempty"`

// file defines the file name within the config map or secret
// File name within the config map or secret
File string `json:"file,omitempty"`
}

Expand Down Expand Up @@ -788,29 +788,11 @@ type SASLConfig struct {
// Type of SASL authentication to use, or `DISABLED` if SASL is not used
Type SASLType `json:"type,omitempty"`

// Reference to the secret or config map containing the client ID and secret
Reference ConfigOrSecret `json:"reference,omitempty"`
// Reference to the secret or config map containing the client ID
ClientIDReference FileReference `json:"clientIDReference,omitempty"`

// Key for client ID within the provided `reference`
ClientIDKey string `json:"clientIDKey,omitempty"`

// Key for client secret within the provided `reference`
ClientSecretKey string `json:"clientSecretKey,omitempty"`
}

type ConfigOrSecret struct {
//+kubebuilder:validation:Enum=configmap;secret
// Type for the reference: "configmap" or "secret"
Type MountableType `json:"type,omitempty"`

// Name of the config map or secret to reference
Name string `json:"name,omitempty"`

// Namespace of the config map or secret. If omitted, assumes same namespace as where NetObserv is deployed.
// If the namespace is different, the config map or the secret will be copied so that it can be mounted as required.
// +optional
//+kubebuilder:default:=""
Namespace string `json:"namespace,omitempty"`
// Reference to the secret or config map containing the client secret
ClientSecretReference FileReference `json:"clientSecretReference,omitempty"`
}

// `DebugConfig` allows tweaking some aspects of the internal configuration of the agent and FLP.
Expand Down
18 changes: 2 additions & 16 deletions api/v1beta1/zz_generated.deepcopy.go

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

127 changes: 90 additions & 37 deletions bundle/manifests/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3245,31 +3245,58 @@ spec:
description: SASL authentication configuration. [Unsupported
(*)].
properties:
clientIDKey:
description: Key for client ID within the provided `reference`
type: string
clientSecretKey:
description: Key for client secret within the provided
`reference`
type: string
reference:
clientIDReference:
description: Reference to the secret or config map containing
the client ID and secret
the client ID
properties:
file:
description: File name within the config map or
secret
type: string
name:
description: Name of the config map or secret to
reference
description: Name of the config map or secret containing
the file
type: string
namespace:
default: ""
description: Namespace of the config map or secret.
If omitted, assumes same namespace as where NetObserv
is deployed. If the namespace is different, the
config map or the secret will be copied so that
it can be mounted as required.
description: Namespace of the config map or secret
containing the file. If omitted, assumes same
namespace as where NetObserv is deployed. If the
namespace is different, the config map or the
secret will be copied so that it can be mounted
as required.
type: string
type:
description: 'Type for the reference: "configmap"
description: 'Type for the file reference: "configmap"
or "secret"'
enum:
- configmap
- secret
type: string
type: object
clientSecretReference:
description: Reference to the secret or config map containing
the client secret
properties:
file:
description: File name within the config map or
secret
type: string
name:
description: Name of the config map or secret containing
the file
type: string
namespace:
default: ""
description: Namespace of the config map or secret
containing the file. If omitted, assumes same
namespace as where NetObserv is deployed. If the
namespace is different, the config map or the
secret will be copied so that it can be mounted
as required.
type: string
type:
description: 'Type for the file reference: "configmap"
or "secret"'
enum:
- configmap
Expand Down Expand Up @@ -3405,29 +3432,55 @@ spec:
sasl:
description: SASL authentication configuration. [Unsupported (*)].
properties:
clientIDKey:
description: Key for client ID within the provided `reference`
type: string
clientSecretKey:
description: Key for client secret within the provided `reference`
type: string
reference:
clientIDReference:
description: Reference to the secret or config map containing
the client ID
properties:
file:
description: File name within the config map or secret
type: string
name:
description: Name of the config map or secret containing
the file
type: string
namespace:
default: ""
description: Namespace of the config map or secret containing
the file. If omitted, assumes same namespace as where
NetObserv is deployed. If the namespace is different,
the config map or the secret will be copied so that
it can be mounted as required.
type: string
type:
description: 'Type for the file reference: "configmap"
or "secret"'
enum:
- configmap
- secret
type: string
type: object
clientSecretReference:
description: Reference to the secret or config map containing
the client ID and secret
the client secret
properties:
file:
description: File name within the config map or secret
type: string
name:
description: Name of the config map or secret to reference
description: Name of the config map or secret containing
the file
type: string
namespace:
default: ""
description: Namespace of the config map or secret. If
omitted, assumes same namespace as where NetObserv is
deployed. If the namespace is different, the config
map or the secret will be copied so that it can be mounted
as required.
description: Namespace of the config map or secret containing
the file. If omitted, assumes same namespace as where
NetObserv is deployed. If the namespace is different,
the config map or the secret will be copied so that
it can be mounted as required.
type: string
type:
description: 'Type for the reference: "configmap" or "secret"'
description: 'Type for the file reference: "configmap"
or "secret"'
enum:
- configmap
- secret
Expand Down Expand Up @@ -4550,24 +4603,24 @@ spec:
description: Reference to the CA file will be ignored
properties:
file:
description: file defines the file name within
the config map or secret
description: File name within the config map or
secret
type: string
name:
description: name of the config map or secret
description: Name of the config map or secret
containing the file
type: string
namespace:
default: ""
description: namespace of the config map or secret
description: Namespace of the config map or secret
containing the file. If omitted, assumes same
namespace as where NetObserv is deployed. If
the namespace is different, the config map or
the secret will be copied so that it can be
mounted as required.
type: string
type:
description: 'type for the file reference: "configmap"
description: 'Type for the file reference: "configmap"
or "secret"'
enum:
- configmap
Expand Down
Loading

0 comments on commit 623a3b2

Please sign in to comment.