Skip to content

Commit

Permalink
feat(swr): add resources and examples (#110)
Browse files Browse the repository at this point in the history
* feat(swr): add resources and examples

* style: remove unnecessary quote

* chore: rename extra to secret
  • Loading branch information
gaetanars authored Jan 17, 2023
1 parent d8774a6 commit 11e8510
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 28 deletions.
10 changes: 10 additions & 0 deletions apis/swr/v1beta1/zz_generated.deepcopy.go

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

23 changes: 21 additions & 2 deletions apis/swr/v1beta1/zz_generated.resolvers.go

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

13 changes: 11 additions & 2 deletions apis/swr/v1beta1/zz_organizationusers_types.go

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

9 changes: 4 additions & 5 deletions apis/swr/v1beta1/zz_repositorysharing_types.go

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

10 changes: 5 additions & 5 deletions config/swr/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ func Configure(p *config.Provider) {
Type: "Organization",
}

// user_id
r.References["user_id"] = config.Reference{
// users.user_id block
r.References["users.user_id"] = config.Reference{
Type: tools.GenerateType("iam", "User"),
}

Expand Down Expand Up @@ -51,8 +51,8 @@ func Configure(p *config.Provider) {
Type: "Repository",
}

r.References["repository"] = config.Reference{
Type: tools.GenerateType("iam", "User"),
}
// sharing_account
r.MetaResource.ArgumentDocs["sharing_account"] = "The Domain Name of the account to share the repository with."

})
}
8 changes: 6 additions & 2 deletions examples-generated/swr/organizationusers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ spec:
testing.upbound.io/example-name: example
users:
- permission: Read
userId: ${var.user_1.id}
userIdSelector:
matchLabels:
testing.upbound.io/example-name: user_1
userName: ${var.user_1.name}
- permission: Read
userId: ${var.user_2.id}
userIdSelector:
matchLabels:
testing.upbound.io/example-name: user_2
userName: ${var.user_2.name}

---
Expand Down
4 changes: 2 additions & 2 deletions examples/iam/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ spec:
description: A user
name: user1-example
passwordSecretRef:
key: example-key
key: password
name: example-secret
namespace: upbound-system
namespace: crossplane-system
8 changes: 8 additions & 0 deletions examples/iam/user.yaml.secret
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: example-secret
namespace: crossplane-system
type: Opaque
stringData:
password: MyStrongPassword
10 changes: 10 additions & 0 deletions examples/swr/organization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: swr.flexibleengine.upbound.io/v1beta1
kind: Organization
metadata:
annotations:
meta.upbound.io/example-id: swr/v1beta1/organization
labels:
testing.upbound.io/example-name: example_swr_organization
name: example-swr-organization
spec:
forProvider: {}
18 changes: 18 additions & 0 deletions examples/swr/organizationusers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: swr.flexibleengine.upbound.io/v1beta1
kind: OrganizationUsers
metadata:
annotations:
meta.upbound.io/example-id: swr/v1beta1/organizationusers
labels:
testing.upbound.io/example-name: example_swr_organizationusers
name: example-swr-organizationusers
spec:
forProvider:
organizationSelector:
matchLabels:
testing.upbound.io/example-name: example_swr_organization
users:
- userIdSelector:
matchLabels:
testing.upbound.io/example-name: user_1
permission: Read
17 changes: 17 additions & 0 deletions examples/swr/repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: swr.flexibleengine.upbound.io/v1beta1
kind: Repository
metadata:
annotations:
meta.upbound.io/example-id: swr/v1beta1/repository
labels:
testing.upbound.io/example-name: example_swr_repository
name: example-swr-repository
spec:
forProvider:
organizationSelector:
matchLabels:
testing.upbound.io/example-name: example_swr_organization
description: Test repository
name: example-swr-repository
isPublic: false
category: linux
19 changes: 19 additions & 0 deletions examples/swr/repositorysharing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: swr.flexibleengine.upbound.io/v1beta1
kind: RepositorySharing
metadata:
annotations:
meta.upbound.io/example-id: swr/v1beta1/repositorysharing
labels:
testing.upbound.io/example-name: example_swr_repositorysharing
name: example-swr-repositorysharing
spec:
forProvider:
deadline: forever
organizationSelector:
matchLabels:
testing.upbound.io/example-name: example_swr_organization
permission: pull
repositorySelector:
matchLabels:
testing.upbound.io/example-name: example_swr_repository
sharingAccount: OCB000xxxx
Loading

0 comments on commit 11e8510

Please # to comment.