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

Handle networking/v1beta1 Ingress resources #1221

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## HEAD (Unreleased)

### Bug Fixes

- Handle networking/v1beta1 Ingress resources. (https://github.com/pulumi/pulumi-kubernetes/pull/1221)

### Improvements

- Add NodeJS usage examples for Helm, Kustomize, and YAML resources. (https://github.com/pulumi/pulumi-kubernetes/pull/1205)
Expand Down
9 changes: 4 additions & 5 deletions provider/pkg/await/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ import (
"reflect"
"time"

"github.com/pulumi/pulumi/sdk/v2/go/common/util/cmdutil"

"github.com/pkg/errors"
"github.com/pulumi/pulumi-kubernetes/provider/v2/pkg/clients"
"github.com/pulumi/pulumi-kubernetes/provider/v2/pkg/kinds"
"github.com/pulumi/pulumi-kubernetes/provider/v2/pkg/metadata"
"github.com/pulumi/pulumi-kubernetes/provider/v2/pkg/openapi"
"github.com/pulumi/pulumi/sdk/v2/go/common/diag"
"github.com/pulumi/pulumi/sdk/v2/go/common/util/cmdutil"
logger "github.com/pulumi/pulumi/sdk/v2/go/common/util/logging"
"k8s.io/api/extensions/v1beta1"
networkingv1b1 "k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -298,12 +297,12 @@ func (iia *ingressInitAwaiter) processIngressEvent(event watch.Event) {
inputIngressName)
}

func decodeIngress(u *unstructured.Unstructured) (*v1beta1.Ingress, error) {
func decodeIngress(u *unstructured.Unstructured) (*networkingv1b1.Ingress, error) {
b, err := u.MarshalJSON()
if err != nil {
return nil, err
}
var obj v1beta1.Ingress
var obj networkingv1b1.Ingress
err = json.Unmarshal(b, &obj)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions provider/pkg/clients/unstructured.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/extensions/v1beta1"
networkingv1b1 "k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
Expand All @@ -40,7 +40,7 @@ func FromUnstructured(obj *unstructured.Unstructured) (metav1.Object, error) {
case kinds.Job:
output = new(batchv1.Job)
case kinds.Ingress:
output = new(v1beta1.Ingress)
output = new(networkingv1b1.Ingress)
case kinds.PersistentVolume:
output = new(corev1.PersistentVolume)
case kinds.PersistentVolumeClaim:
Expand Down