Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
renamed SecretConfigmap type to Bindable
- because OperandConfig will be extended to handle more than just
  Secrets and Configmaps

Signed-off-by: Henry H Li <[email protected]>
  • Loading branch information
bitscuit committed Nov 2, 2023
commit bd9f6542ca12e7749cc9fb99f52c466e861bd62e
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ bundle-manifests:
-q --overwrite --version $(OPERATOR_VERSION) $(BUNDLE_METADATA_OPTS)
$(OPERATOR_SDK) bundle validate ./bundle
$(YQ) eval-all -i '.spec.relatedImages = load("config/manifests/bases/operand-deployment-lifecycle-manager.clusterserviceversion.yaml").spec.relatedImages' bundle/manifests/operand-deployment-lifecycle-manager.clusterserviceversion.yaml
# Need to replace fields this way to avoid changing PROJECT name and CSV file name, which may or may not impact CICD automation
@# Need to replace fields this way to avoid changing PROJECT name and CSV file name, which may or may not impact CICD automation
$(YQ) e -i '.annotations["operators.operatorframework.io.bundle.package.v1"] = "ibm-odlm"' bundle/metadata/annotations.yaml
sed -i'' s/operand-deployment-lifecycle-manager/ibm-odlm/ bundle.Dockerfile

Expand Down
11 changes: 8 additions & 3 deletions api/v1alpha1/operandbindinfo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,16 @@ type OperandBindInfoSpec struct {
Description string `json:"description,omitempty"`
// The bindings section is used to specify information about the access/configuration data that is to be shared.
// +optional
Bindings map[string]SecretConfigmap `json:"bindings,omitempty"`
Bindings map[string]Bindable `json:"bindings,omitempty"`
}

// SecretConfigmap is a pair of Secret and/or Configmap.
type SecretConfigmap struct {
// Bindable is a Kubernetes resources to be shared from one namespace to another.
// List of supported resources are Secrets, Configmaps, Services, and Routes.
// Secrets and Configmaps will be copied such that a new Secret/Configmap with
// exactly the same data will be created in the target namespace.
// Services and Routes data will be copied into a configmap in the target
// namespace.
type Bindable struct {
// The secret identifies an existing secret. if it exists, the ODLM will share to the namespace of the OperandRequest.
// +optional
Secret string `json:"secret,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/operandrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Operand struct {
Name string `json:"name"`
// The bindings section is used to specify names of secret and/or configmap.
// +optional
Bindings map[string]SecretConfigmap `json:"bindings,omitempty"`
Bindings map[string]Bindable `json:"bindings,omitempty"`
// Kind is used when users want to deploy multiple custom resources.
// Kind identifies the kind of the custom resource.
// +optional
Expand Down
34 changes: 17 additions & 17 deletions api/v1alpha1/zz_generated.deepcopy.go

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

7 changes: 6 additions & 1 deletion bundle/manifests/operator.ibm.com_operandbindinfos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ spec:
properties:
bindings:
additionalProperties:
description: SecretConfigmap is a pair of Secret and/or Configmap.
description: Bindable is a Kubernetes resources to be shared from
one namespace to another. List of supported resources are Secrets,
Configmaps, Services, and Routes. Secrets and Configmaps will
be copied such that a new Secret/Configmap with exactly the same
data will be created in the target namespace. Services and Routes
data will be copied into a configmap in the target namespace.
properties:
configmap:
description: The configmap identifies an existing configmap
Expand Down
10 changes: 8 additions & 2 deletions bundle/manifests/operator.ibm.com_operandrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ spec:
type: string
bindings:
additionalProperties:
description: SecretConfigmap is a pair of Secret and/or
Configmap.
description: Bindable is a Kubernetes resources to be
shared from one namespace to another. List of supported
resources are Secrets, Configmaps, Services, and Routes.
Secrets and Configmaps will be copied such that a
new Secret/Configmap with exactly the same data will
be created in the target namespace. Services and Routes
data will be copied into a configmap in the target
namespace.
properties:
configmap:
description: The configmap identifies an existing
Expand Down
7 changes: 6 additions & 1 deletion config/crd/bases/operator.ibm.com_operandbindinfos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ spec:
properties:
bindings:
additionalProperties:
description: SecretConfigmap is a pair of Secret and/or Configmap.
description: Bindable is a Kubernetes resources to be shared from
one namespace to another. List of supported resources are Secrets,
Configmaps, Services, and Routes. Secrets and Configmaps will
be copied such that a new Secret/Configmap with exactly the same
data will be created in the target namespace. Services and Routes
data will be copied into a configmap in the target namespace.
properties:
configmap:
description: The configmap identifies an existing configmap
Expand Down
10 changes: 8 additions & 2 deletions config/crd/bases/operator.ibm.com_operandrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,14 @@ spec:
type: string
bindings:
additionalProperties:
description: SecretConfigmap is a pair of Secret and/or
Configmap.
description: Bindable is a Kubernetes resources to be
shared from one namespace to another. List of supported
resources are Secrets, Configmaps, Services, and Routes.
Secrets and Configmaps will be copied such that a
new Secret/Configmap with exactly the same data will
be created in the target namespace. Services and Routes
data will be copied into a configmap in the target
namespace.
properties:
configmap:
description: The configmap identifies an existing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
properties:
bindings:
additionalProperties:
description: SecretConfigmap is a pair of Secret and/or Configmap.
description: Bindable is a pair of Secret and/or Configmap.
properties:
configmap:
description: The configmap identifies an existing configmap
Expand Down
2 changes: 1 addition & 1 deletion config/e2e/crd/bases/operator.ibm.com_operandrequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
type: string
bindings:
additionalProperties:
description: SecretConfigmap is a pair of Secret and/or
description: Bindable is a pair of Secret and/or
Configmap.
properties:
configmap:
Expand Down
6 changes: 3 additions & 3 deletions controllers/testutil/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func OperandRequestObj(registryName, registryNamespace, requestName, requestName
},
{
Name: "mongodb-atlas-kubernetes",
Bindings: map[string]apiv1alpha1.SecretConfigmap{
Bindings: map[string]apiv1alpha1.Bindable{
"public": {
Secret: "secret4",
Configmap: "cm4",
Expand Down Expand Up @@ -331,7 +331,7 @@ func OperandRequestObjWithProtected(registryName, registryNamespace, requestName
},
{
Name: "mongodb-atlas-kubernetes",
Bindings: map[string]apiv1alpha1.SecretConfigmap{
Bindings: map[string]apiv1alpha1.Bindable{
"protected": {
Secret: "secret5",
Configmap: "cm5",
Expand All @@ -356,7 +356,7 @@ func OperandBindInfoObj(name, namespace, registryName, registryNamespace string)
Operand: "mongodb-atlas-kubernetes",
Registry: registryName,
RegistryNamespace: registryNamespace,
Bindings: map[string]apiv1alpha1.SecretConfigmap{
Bindings: map[string]apiv1alpha1.Bindable{
"public": {
Secret: "secret1",
Configmap: "cm1",
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ func newOperandRequestWithBindinfo(name, namespace, RegistryNamespace string) *v
Operands: []v1alpha1.Operand{
{
Name: "mongodb-atlas-kubernetes",
Bindings: map[string]v1alpha1.SecretConfigmap{
Bindings: map[string]v1alpha1.Bindable{
"public": {
Secret: "mongodb-secret",
Configmap: "mongodb-configmap",
Expand All @@ -817,7 +817,7 @@ func newOperandBindInfoCR(name, namespace, RegistryNamespace string) *v1alpha1.O
Registry: OperandRegistryCrName,
RegistryNamespace: RegistryNamespace,

Bindings: map[string]v1alpha1.SecretConfigmap{
Bindings: map[string]v1alpha1.Bindable{
"public": {
Secret: "mongodb-secret",
Configmap: "mongodb-configmap",
Expand Down