Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add await support for networking.k8s.io/v1 variant of ingress #1795

Merged
merged 10 commits into from
Nov 12, 2021

Conversation

viveklak
Copy link
Contributor

@viveklak viveklak commented Nov 11, 2021

Proposed changes

It appears the core issue with the lack of correct await on ingress objects was because of missing support for networking.k8s.io/v1 variants of the ingress object. I considered trying to canonicalize against the preferred version of the api server, but things get complicated quickly when taking upgrades into account. The approach here allows us to support all of the known versions for ingress by adjusting the await logic to each variant's API shape.

Related issues (optional)

#1649 #1498

@viveklak viveklak marked this pull request as draft November 11, 2021 07:05
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@viveklak viveklak changed the title Add support for networking/v1 variant of ingress Add await support for networking.k8s.io/v1 variant of ingress Nov 12, 2021
@viveklak viveklak marked this pull request as ready for review November 12, 2021 00:37
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

2 similar comments
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

tests/sdk/nodejs/examples/ingress/index.ts Outdated Show resolved Hide resolved
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

1 similar comment
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Member

@mikhailshilkov mikhailshilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to me broadly - although the actual logic is beyond my skill level. I trust Vivek and Levi on this one.

assert.Equal(t, tokens.Type("kubernetes:core/v1:Service"), redisMasterService.URN.Type())
name, _ = openapi.Pluck(redisMasterService.Outputs, "metadata", "name")
assert.Equal(t, "redis-master", name)
status, _ = openapi.Pluck(redisMasterService.Outputs, "spec", "clusterIP")
assert.True(t, len(status.(string)) > 1)

// Verify redis-slave service.
redisSlaveService := stackInfo.Deployment.Resources[6]
redisSlaveService := stackInfo.Deployment.Resources[9]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Index-based lookups look somewhat unreliable, I wonder if we could change to name-based?

Copy link
Contributor Author

@viveklak viveklak Nov 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copy pasta from a previous test I based off of. Its not material to the ingress behavior under test here so removed the resource assertions entirely.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

3 similar comments
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants