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

Remove imperative auth API resources #2413

Merged
merged 13 commits into from May 17, 2023
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,6 +1,7 @@
## Unreleased

- Handle resource change from static name to autoname under SSA (https://github.com/pulumi/pulumi-kubernetes/pull/2392)
- Remove imperative authentication/v1 resources, TokenRequest and TokenReview (https://github.com/pulumi/pulumi-kubernetes/pull/2413)
rquitales marked this conversation as resolved.
Show resolved Hide resolved

## 3.27.1 (May 11, 2023)

Expand Down
668 changes: 20 additions & 648 deletions provider/cmd/pulumi-resource-kubernetes/schema.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion provider/pkg/gen/kinds/kinds.tmpl
Expand Up @@ -89,7 +89,6 @@ func (k Kind) Namespaced() (known bool, namespaced bool) {
SelfSubjectRulesReview,
rquitales marked this conversation as resolved.
Show resolved Hide resolved
StorageClass,
SubjectAccessReview,
TokenReview,
ValidatingWebhookConfiguration,
VolumeAttachment:
return true, false
Expand Down
4 changes: 3 additions & 1 deletion provider/pkg/gen/typegen.go
Expand Up @@ -202,7 +202,9 @@ func (d definition) isTopLevel() bool {
// by Pulumi.
switch fmt.Sprintf("%s/%s", d.gvk.GroupVersion().String(), d.gvk.Kind) {
case "policy/v1beta1/Eviction", "policy/v1/Eviction", "v1/Status", "apps/v1beta1/Scale", "apps/v1beta2/Scale",
"autoscaling/v1/Scale", "extensions/v1beta1/Scale", "core/v1/ComponentStatus", "core/v1/ComponentStatusList":
"autoscaling/v1/Scale", "extensions/v1beta1/Scale", "core/v1/ComponentStatus", "core/v1/ComponentStatusList",
"authentication/v1/TokenRequest", "authentication/v1/TokenReview", "authentication/v1beta1/TokenReview",
"authentication/v1beta1/SelfSubjectReview", "authentication/v1alpha1/SelfSubjectReview":
return false
}

Expand Down
9 changes: 0 additions & 9 deletions provider/pkg/kinds/deprecated.go
Expand Up @@ -147,11 +147,6 @@ func AddedInVersion(gvk *schema.GroupVersionKind) *cluster.ServerVersion {
case AuditSink, AuditSinkList:
return &v113
}
case AuthenticationV1:
switch k {
case TokenRequest:
return &v116
}
case AutoscalingV2B2:
switch k {
case HorizontalPodAutoscaler, HorizontalPodAutoscalerList:
Expand Down Expand Up @@ -276,8 +271,6 @@ func RemovedInVersion(gvk schema.GroupVersionKind) *cluster.ServerVersion {
return &v122
case ApiextensionsV1B1:
return &v122
case AuthenticationV1B1:
return &v122
case AuthorizationV1B1:
return &v122
case BatchV2A1:
Expand Down Expand Up @@ -334,8 +327,6 @@ func SuggestedAPIVersion(gvk schema.GroupVersionKind) string {
return fmt.Sprintf(gvkFmt, ApiregistrationV1, k)
case AppsV1B1, AppsV1B2:
return fmt.Sprintf(gvkFmt, AppsV1, k)
case AuthenticationV1B1:
return fmt.Sprintf(gvkFmt, AuthenticationV1, k)
case AuthorizationV1B1:
return fmt.Sprintf(gvkFmt, AuthorizationV1, k)
case AutoscalingV2B1:
Expand Down
3 changes: 0 additions & 3 deletions provider/pkg/kinds/deprecated_test.go
Expand Up @@ -37,7 +37,6 @@ func TestDeprecatedApiVersion(t *testing.T) {
{toGVK(AppsV1, Deployment), nil, false},
{toGVK(AppsV1B1, Deployment), nil, true},
{toGVK(AppsV1B2, Deployment), nil, true},
{toGVK(AuthenticationV1B1, TokenReview), nil, true},
{toGVK(AuthorizationV1B1, LocalSubjectAccessReview), nil, true},
{toGVK(AuthorizationV1B1, SelfSubjectAccessReview), nil, true},
{toGVK(AuthorizationV1B1, SelfSubjectRulesReview), nil, true},
Expand Down Expand Up @@ -155,7 +154,6 @@ func TestSuggestedApiVersion(t *testing.T) {
{toGVK(ApiregistrationV1B1, APIServiceList), wantStr(ApiregistrationV1, APIServiceList)},
{toGVK(AppsV1B1, Deployment), wantStr(AppsV1, Deployment)},
{toGVK(AppsV1B2, Deployment), wantStr(AppsV1, Deployment)},
{toGVK(AuthenticationV1B1, TokenReview), wantStr(AuthenticationV1, TokenReview)},
{toGVK(AuthorizationV1B1, LocalSubjectAccessReview), wantStr(AuthorizationV1, LocalSubjectAccessReview)},
{toGVK(AutoscalingV2B1, HorizontalPodAutoscaler), wantStr(AutoscalingV1, HorizontalPodAutoscaler)},
{toGVK(BatchV2A1, CronJob), wantStr(BatchV1B1, CronJob)},
Expand Down Expand Up @@ -201,7 +199,6 @@ func TestRemovedInVersion(t *testing.T) {
{toGVK(ApiextensionsV1B1, CustomResourceDefinition), &v122},
{toGVK(AppsV1B1, Deployment), &v116},
{toGVK(AppsV1B2, Deployment), &v116},
{toGVK(AuthenticationV1B1, TokenReview), &v122},
{toGVK(AuthorizationV1B1, LocalSubjectAccessReview), &v122},
{toGVK(BatchV2A1, CronJob), &v121},
{toGVK(CoordinationV1B1, Lease), &v122},
Expand Down
10 changes: 0 additions & 10 deletions provider/pkg/kinds/kinds.go
Expand Up @@ -135,7 +135,6 @@ const (
Secret Kind = "Secret"
SecretList Kind = "SecretList"
SelfSubjectAccessReview Kind = "SelfSubjectAccessReview"
SelfSubjectReview Kind = "SelfSubjectReview"
SelfSubjectRulesReview Kind = "SelfSubjectRulesReview"
Service Kind = "Service"
ServiceAccount Kind = "ServiceAccount"
Expand All @@ -147,8 +146,6 @@ const (
StorageClass Kind = "StorageClass"
StorageClassList Kind = "StorageClassList"
SubjectAccessReview Kind = "SubjectAccessReview"
TokenRequest Kind = "TokenRequest"
TokenReview Kind = "TokenReview"
ValidatingAdmissionPolicy Kind = "ValidatingAdmissionPolicy"
ValidatingAdmissionPolicyBinding Kind = "ValidatingAdmissionPolicyBinding"
ValidatingAdmissionPolicyBindingList Kind = "ValidatingAdmissionPolicyBindingList"
Expand Down Expand Up @@ -215,7 +212,6 @@ func (k Kind) Namespaced() (known bool, namespaced bool) {
SelfSubjectRulesReview,
StorageClass,
SubjectAccessReview,
TokenReview,
ValidatingWebhookConfiguration,
VolumeAttachment:
return true, false
Expand All @@ -239,9 +235,6 @@ const (
AppsV1B1 groupVersion = "apps/v1beta1"
AppsV1B2 groupVersion = "apps/v1beta2"
AuditregistrationV1A1 groupVersion = "auditregistration.k8s.io/v1alpha1"
AuthenticationV1 groupVersion = "authentication.k8s.io/v1"
AuthenticationV1A1 groupVersion = "authentication.k8s.io/v1alpha1"
AuthenticationV1B1 groupVersion = "authentication.k8s.io/v1beta1"
AuthorizationV1 groupVersion = "authorization.k8s.io/v1"
AuthorizationV1B1 groupVersion = "authorization.k8s.io/v1beta1"
AutoscalingV1 groupVersion = "autoscaling/v1"
Expand Down Expand Up @@ -314,9 +307,6 @@ var KnownGroupVersions = codegen.NewStringSet(
"apps/v1beta1",
"apps/v1beta2",
"auditregistration.k8s.io/v1alpha1",
"authentication.k8s.io/v1",
"authentication.k8s.io/v1alpha1",
"authentication.k8s.io/v1beta1",
"authorization.k8s.io/v1",
"authorization.k8s.io/v1beta1",
"autoscaling/v1",
Expand Down
4 changes: 0 additions & 4 deletions sdk/dotnet/Authentication/V1Beta1/TokenReview.cs
Expand Up @@ -77,10 +77,6 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
lblackstone marked this conversation as resolved.
Show resolved Hide resolved
{
Version = Utilities.Version,
Aliases =
{
new global::Pulumi.Alias { Type = "kubernetes:authentication.k8s.io/v1:TokenReview"},
},
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
4 changes: 0 additions & 4 deletions sdk/dotnet/Authentication/V1Beta1/TokenReviewPatch.cs
Expand Up @@ -83,10 +83,6 @@ private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions?
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
Aliases =
{
new global::Pulumi.Alias { Type = "kubernetes:authentication.k8s.io/v1:TokenReviewPatch"},
},
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
Expand Down
45 changes: 0 additions & 45 deletions sdk/dotnet/Yaml/Yaml.cs
Expand Up @@ -203,21 +203,6 @@
case var t when t == typeof(AuditRegistraion.V1Alpha1.AuditSinkList):
groupVersionKind = "auditregistration.k8s.io/v1alpha1/AuditSinkList";
break;
case var t when t == typeof(Authentication.V1.TokenRequest):
groupVersionKind = "authentication.k8s.io/v1/TokenRequest";
break;
case var t when t == typeof(Authentication.V1.TokenReview):
groupVersionKind = "authentication.k8s.io/v1/TokenReview";
break;
case var t when t == typeof(Authentication.V1Alpha1.SelfSubjectReview):
groupVersionKind = "authentication.k8s.io/v1alpha1/SelfSubjectReview";
break;
case var t when t == typeof(Authentication.V1Beta1.SelfSubjectReview):
groupVersionKind = "authentication.k8s.io/v1beta1/SelfSubjectReview";
break;
case var t when t == typeof(Authentication.V1Beta1.TokenReview):
groupVersionKind = "authentication.k8s.io/v1beta1/TokenReview";
break;
case var t when t == typeof(Authorization.V1.LocalSubjectAccessReview):
groupVersionKind = "authorization.k8s.io/v1/LocalSubjectAccessReview";
break;
Expand Down Expand Up @@ -862,7 +847,7 @@
transformations.Add(SkipAwait);
}

if (config.Files != null)

Check warning on line 850 in sdk/dotnet/Yaml/Yaml.cs

View workflow job for this annotation

GitHub Actions / build_sdks (dotnet)

Dereference of a possibly null reference.
{
var files = new List<string>();
foreach (var file in config.Files)
Expand Down Expand Up @@ -1158,7 +1143,7 @@

var meta = (ImmutableDictionary<string, object>)obj["metadata"];
var id = Output.Create((string)meta["name"]);
if (meta.TryGetValue("namespace", out object ns))

Check warning on line 1146 in sdk/dotnet/Yaml/Yaml.cs

View workflow job for this annotation

GitHub Actions / build_sdks (dotnet)

Converting null literal or possible null value to non-nullable type.
id = Output.Format($"{ns}/{id}");
if (resourcePrefix != null)
id = Output.Format($"{resourcePrefix}-{id}");
Expand Down Expand Up @@ -1321,36 +1306,6 @@
id.Apply(id => ($"auditregistration.k8s.io/v1alpha1/AuditSink::{id}",
new AuditRegistraion.V1Alpha1.AuditSink(id, obj!, opts) as KubernetesResource))
};
case "authentication.k8s.io/v1/TokenRequest":
return new[]
{
id.Apply(id => ($"authentication.k8s.io/v1/TokenRequest::{id}",
new Authentication.V1.TokenRequest(id, obj!, opts) as KubernetesResource))
};
case "authentication.k8s.io/v1/TokenReview":
return new[]
{
id.Apply(id => ($"authentication.k8s.io/v1/TokenReview::{id}",
new Authentication.V1.TokenReview(id, obj!, opts) as KubernetesResource))
};
case "authentication.k8s.io/v1alpha1/SelfSubjectReview":
return new[]
{
id.Apply(id => ($"authentication.k8s.io/v1alpha1/SelfSubjectReview::{id}",
new Authentication.V1Alpha1.SelfSubjectReview(id, obj!, opts) as KubernetesResource))
};
case "authentication.k8s.io/v1beta1/SelfSubjectReview":
return new[]
{
id.Apply(id => ($"authentication.k8s.io/v1beta1/SelfSubjectReview::{id}",
new Authentication.V1Beta1.SelfSubjectReview(id, obj!, opts) as KubernetesResource))
};
case "authentication.k8s.io/v1beta1/TokenReview":
return new[]
{
id.Apply(id => ($"authentication.k8s.io/v1beta1/TokenReview::{id}",
new Authentication.V1Beta1.TokenReview(id, obj!, opts) as KubernetesResource))
};
case "authorization.k8s.io/v1/LocalSubjectAccessReview":
return new[]
{
Expand Down
50 changes: 0 additions & 50 deletions sdk/go/kubernetes/authentication/v1/init.go

This file was deleted.