forked from keptn/lifecycle-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add configurable service account to KeptnTasks (keptn#2254)
Signed-off-by: Griffin <[email protected]> Signed-off-by: Prakriti Mandal <[email protected]>
- Loading branch information
Showing
13 changed files
with
370 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
lifecycle-operator/apis/lifecycle/v1alpha3/keptntaskdefinition_types_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package v1alpha3 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestTaskDefinition_GetServiceAccountNoName(t *testing.T) { | ||
d := &KeptnTaskDefinition{ | ||
Spec: KeptnTaskDefinitionSpec{}, | ||
} | ||
svcAccname := d.GetServiceAccount() | ||
require.Equal(t, svcAccname, "") | ||
} | ||
|
||
func TestTaskDefinition_GetServiceAccountName(t *testing.T) { | ||
sAName := "sva" | ||
d := &KeptnTaskDefinition{ | ||
Spec: KeptnTaskDefinitionSpec{ | ||
ServiceAccount: &ServiceAccountSpec{ | ||
Name: sAName, | ||
}, | ||
}, | ||
} | ||
svcAccname := d.GetServiceAccount() | ||
require.Equal(t, svcAccname, sAName) | ||
} | ||
|
||
func TestTaskDefinition_GetAutomountServiceAccountToken(t *testing.T) { | ||
token := true | ||
d := &KeptnTaskDefinition{ | ||
Spec: KeptnTaskDefinitionSpec{ | ||
AutomountServiceAccountToken: &AutomountServiceAccountTokenSpec{ | ||
Type: &token, | ||
}, | ||
}, | ||
} | ||
require.True(t, *d.GetAutomountServiceAccountToken()) | ||
} |
45 changes: 45 additions & 0 deletions
45
lifecycle-operator/apis/lifecycle/v1alpha3/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.