Skip to content

Commit 3e18647

Browse files
committed
controllers: Renamed PostgresTableIdentifier to PostgresIdentifier.
This is used to identify schema-scoped Postgres objects, and not only tables.
1 parent 0f2d99e commit 3e18647

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

api/v1alpha1/common_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ type PostgresRef struct {
3636
Variant string `json:"variant,omitempty"`
3737
}
3838

39-
// PostgresTableIdentifier represents an identifier for a table, e.g. a pair
40-
// of schema and table name.
41-
type PostgresTableIdentifier struct {
39+
// PostgresIdentifier represents an identifier for a table, e.g. a pair of
40+
// schema and table name.
41+
type PostgresIdentifier struct {
4242
// Name is the name of the table
4343
Name string `json:"name"`
4444

api/v1alpha1/postgresconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type Publication struct {
4242

4343
// Tables is the list of tables to include in the publication. If the list
4444
// is empty or omitted, publication is created for all tables
45-
Tables []PostgresTableIdentifier `json:"tables,omitempty"`
45+
Tables []PostgresIdentifier `json:"tables,omitempty"`
4646

4747
// Operations determines which DML operations will be published by the
4848
// publication to subscribers. The allowed operations are insert, update,

api/v1alpha1/postgrespublication_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type PostgresPublicationSpec struct {
3535

3636
// Tables is the list of tables to include in the publication. If the list
3737
// is empty or omitted, publication is created for all tables
38-
Tables []PostgresTableIdentifier `json:"tables"`
38+
Tables []PostgresIdentifier `json:"tables"`
3939

4040
// Operations determines which DML operations will be published by the
4141
// publication to subscribers. The allowed operations are insert, update,

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controllers/postgresconfig_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func createConfigForPublications(
115115
Publications: []postgresv1alpha1.Publication{
116116
{
117117
Name: publicationName,
118-
Tables: []postgresv1alpha1.PostgresTableIdentifier{
118+
Tables: []postgresv1alpha1.PostgresIdentifier{
119119
{Name: tableName, Schema: "public"},
120120
},
121121
},

controllers/postgrespublication_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
4141
Spec: postgresv1alpha1.PostgresPublicationSpec{
4242
PostgresRef: PostgresContainerRef(ctx),
4343
Name: publicationName,
44-
Tables: []postgresv1alpha1.PostgresTableIdentifier{
44+
Tables: []postgresv1alpha1.PostgresIdentifier{
4545
{
4646
Name: "jobs",
4747
Schema: "public",
@@ -68,7 +68,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
6868
Spec: postgresv1alpha1.PostgresPublicationSpec{
6969
PostgresRef: PostgresContainerRef(ctx),
7070
Name: publicationName,
71-
Tables: []postgresv1alpha1.PostgresTableIdentifier{
71+
Tables: []postgresv1alpha1.PostgresIdentifier{
7272
{
7373
Name: "jobs",
7474
Schema: "public",
@@ -113,7 +113,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
113113
Spec: postgresv1alpha1.PostgresPublicationSpec{
114114
PostgresRef: PostgresContainerRef(ctx),
115115
Name: publicationName,
116-
Tables: []postgresv1alpha1.PostgresTableIdentifier{
116+
Tables: []postgresv1alpha1.PostgresIdentifier{
117117
{
118118
Name: "jobs",
119119
Schema: "public",
@@ -136,7 +136,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
136136

137137
publication.Spec.Tables = append(
138138
publication.Spec.Tables,
139-
postgresv1alpha1.PostgresTableIdentifier{
139+
postgresv1alpha1.PostgresIdentifier{
140140
Name: "users",
141141
Schema: "public",
142142
},
@@ -177,7 +177,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
177177
Spec: postgresv1alpha1.PostgresPublicationSpec{
178178
PostgresRef: PostgresContainerRef(ctx),
179179
Name: publicationName,
180-
Tables: []postgresv1alpha1.PostgresTableIdentifier{
180+
Tables: []postgresv1alpha1.PostgresIdentifier{
181181
{
182182
Name: "jobs",
183183
Schema: "public",
@@ -202,7 +202,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
202202
}, publication)
203203
Expect(err).NotTo(HaveOccurred(), "failed to get latest PostgresPublication resource")
204204

205-
publication.Spec.Tables = []postgresv1alpha1.PostgresTableIdentifier{
205+
publication.Spec.Tables = []postgresv1alpha1.PostgresIdentifier{
206206
publication.Spec.Tables[0],
207207
}
208208

@@ -240,7 +240,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
240240
Spec: postgresv1alpha1.PostgresPublicationSpec{
241241
PostgresRef: PostgresContainerRef(ctx),
242242
Name: publicationName,
243-
Tables: []postgresv1alpha1.PostgresTableIdentifier{
243+
Tables: []postgresv1alpha1.PostgresIdentifier{
244244
{
245245
Name: "jobs",
246246
Schema: "public",
@@ -294,7 +294,7 @@ var _ = Context("Inside of a new Postgres instance", func() {
294294
Spec: postgresv1alpha1.PostgresPublicationSpec{
295295
PostgresRef: PostgresContainerRef(ctx),
296296
Name: publicationName,
297-
Tables: []postgresv1alpha1.PostgresTableIdentifier{
297+
Tables: []postgresv1alpha1.PostgresIdentifier{
298298
{
299299
Name: "jobs",
300300
Schema: "public",

0 commit comments

Comments
 (0)