Skip to content

Commit 19ed719

Browse files
Issue#237 (#248)
* refactor to prevent attempting t delete non-deletable resources Signed-off-by: raffaelespazzoli <[email protected]> * documented Signed-off-by: raffaelespazzoli <[email protected]> * updated dependencies Signed-off-by: raffaelespazzoli <[email protected]> * updated dependencies #2 Signed-off-by: raffaelespazzoli <[email protected]> * upgraded go to 1.21 Signed-off-by: raffaelespazzoli <[email protected]> --------- Signed-off-by: raffaelespazzoli <[email protected]>
1 parent dba35f6 commit 19ed719

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+259
-87
lines changed

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
RUN_UNIT_TESTS: true
1414
RUN_INTEGRATION_TESTS: true
1515
RUN_HELMCHART_TEST: true
16-
GO_VERSION: ~1.19
16+
GO_VERSION: ~1.21
1717
OPERATOR_SDK_VERSION: v1.25.3

.github/workflows/push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
RUN_UNIT_TESTS: true
2121
RUN_INTEGRATION_TESTS: true
2222
RUN_HELMCHART_TEST: true
23-
GO_VERSION: ~1.19
23+
GO_VERSION: ~1.21
2424
OPERATOR_SDK_VERSION: v1.25.3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.19 as builder
2+
FROM golang:1.21 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

api/v1alpha1/authenginemount_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ type AuthEngineMountSpec struct {
5353
Name string `json:"name,omitempty"`
5454
}
5555

56+
func (d *AuthEngineMount) IsDeletable() bool {
57+
return true
58+
}
59+
5660
func (d *AuthEngineMount) GetPath() string {
5761
if d.Spec.Name != "" {
5862
return vaultutils.CleansePath(d.GetEngineListPath() + "/" + string(d.Spec.Path) + "/" + d.Spec.Name)

api/v1alpha1/azureauthengineconfig_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ type AzureConfig struct {
130130
var _ vaultutils.VaultObject = &AzureAuthEngineConfig{}
131131
var _ vaultutils.ConditionsAware = &AzureAuthEngineConfig{}
132132

133+
func (d *AzureAuthEngineConfig) IsDeletable() bool {
134+
return true
135+
}
136+
133137
func (d *AzureAuthEngineConfig) GetVaultConnection() *vaultutils.VaultConnection {
134138
return d.Spec.Connection
135139
}

api/v1alpha1/azureauthenginerole_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ func init() {
188188
SchemeBuilder.Register(&AzureAuthEngineRole{}, &AzureAuthEngineRoleList{})
189189
}
190190

191+
func (d *AzureAuthEngineRole) IsDeletable() bool {
192+
return true
193+
}
194+
191195
func (r *AzureAuthEngineRole) GetConditions() []metav1.Condition {
192196
return r.Status.Conditions
193197
}

api/v1alpha1/azuresecretengineconfig_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ func init() {
128128
SchemeBuilder.Register(&AzureSecretEngineConfig{}, &AzureSecretEngineConfigList{})
129129
}
130130

131+
func (d *AzureSecretEngineConfig) IsDeletable() bool {
132+
return true
133+
}
134+
131135
func (r *AzureSecretEngineConfig) SetConditions(conditions []metav1.Condition) {
132136
r.Status.Conditions = conditions
133137
}

api/v1alpha1/databasesecretengineconfig_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ func (d *DatabaseSecretEngineConfig) GetVaultConnection() *vaultutils.VaultConne
6969
return d.Spec.Connection
7070
}
7171

72+
func (d *DatabaseSecretEngineConfig) IsDeletable() bool {
73+
return true
74+
}
75+
7276
func (d *DatabaseSecretEngineConfig) GetPath() string {
7377
if d.Spec.Name != "" {
7478
return vaultutils.CleansePath(string(d.Spec.Path) + "/" + "config" + "/" + d.Spec.Name)

api/v1alpha1/databasesecretenginerole_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ var _ vaultutils.VaultObject = &DatabaseSecretEngineRole{}
5959

6060
var _ vaultutils.ConditionsAware = &DatabaseSecretEngineRole{}
6161

62+
func (d *DatabaseSecretEngineRole) IsDeletable() bool {
63+
return true
64+
}
65+
6266
func (d *DatabaseSecretEngineRole) GetVaultConnection() *vaultutils.VaultConnection {
6367
return d.Spec.Connection
6468
}

api/v1alpha1/databasesecretenginestaticrole_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ func (d *DatabaseSecretEngineStaticRole) GetVaultConnection() *vaultutils.VaultC
144144
return d.Spec.Connection
145145
}
146146

147+
func (d *DatabaseSecretEngineStaticRole) IsDeletable() bool {
148+
return true
149+
}
150+
147151
func (d *DatabaseSecretEngineStaticRole) GetPath() string {
148152
if d.Spec.Name != "" {
149153
return vaultutils.CleansePath(string(d.Spec.Path) + "/" + "static-roles" + "/" + d.Spec.Name)

0 commit comments

Comments
 (0)