diff --git a/deploy/crds.yml b/deploy/crds.yml index bcfb9a13..658ca23d 100644 --- a/deploy/crds.yml +++ b/deploy/crds.yml @@ -1013,3 +1013,32 @@ spec: file: description: Credentials file, generated with github.com/nats-io/nsc tool. type: string + token: + description: The token to be used to connect to the NATS Service. + type: object + properties: + secret: + type: object + properties: + name: + description: Name of the secret with the token. + type: string + token: + description: Key in the secret that contains the token. + type: string + userWithPassword: + description: The user and password to be used to connect to the NATS Service. + type: object + properties: + secret: + type: object + properties: + name: + description: Name of the secret with the user and password. + type: string + user: + description: Key in the secret that contains the user. + type: string + password: + description: Key in the secret that contains the password. + type: string diff --git a/pkg/jetstream/apis/jetstream/v1beta2/zz_generated.deepcopy.go b/pkg/jetstream/apis/jetstream/v1beta2/zz_generated.deepcopy.go index 5525e111..89a9ca28 100644 --- a/pkg/jetstream/apis/jetstream/v1beta2/zz_generated.deepcopy.go +++ b/pkg/jetstream/apis/jetstream/v1beta2/zz_generated.deepcopy.go @@ -101,6 +101,16 @@ func (in *AccountSpec) DeepCopyInto(out *AccountSpec) { *out = new(CredsSecret) **out = **in } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(TokenSecret) + **out = **in + } + if in.UserWithPassword != nil { + in, out := &in.UserWithPassword, &out.UserWithPassword + *out = new(UserWithPassword) + **out = **in + } return } @@ -547,3 +557,37 @@ func (in *TLSSecret) DeepCopy() *TLSSecret { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TokenSecret) DeepCopyInto(out *TokenSecret) { + *out = *in + out.Secret = in.Secret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenSecret. +func (in *TokenSecret) DeepCopy() *TokenSecret { + if in == nil { + return nil + } + out := new(TokenSecret) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserWithPassword) DeepCopyInto(out *UserWithPassword) { + *out = *in + out.Secret = in.Secret + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserWithPassword. +func (in *UserWithPassword) DeepCopy() *UserWithPassword { + if in == nil { + return nil + } + out := new(UserWithPassword) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/accountspec.go b/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/accountspec.go index a3a27b65..5f3d641c 100644 --- a/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/accountspec.go +++ b/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/accountspec.go @@ -18,9 +18,11 @@ package v1beta2 // AccountSpecApplyConfiguration represents an declarative configuration of the AccountSpec type for use // with apply. type AccountSpecApplyConfiguration struct { - Servers []string `json:"servers,omitempty"` - TLS *TLSSecretApplyConfiguration `json:"tls,omitempty"` - Creds *CredsSecretApplyConfiguration `json:"creds,omitempty"` + Servers []string `json:"servers,omitempty"` + TLS *TLSSecretApplyConfiguration `json:"tls,omitempty"` + Creds *CredsSecretApplyConfiguration `json:"creds,omitempty"` + Token *TokenSecretApplyConfiguration `json:"token,omitempty"` + UserWithPassword *UserWithPasswordApplyConfiguration `json:"userWithPassword,omitempty"` } // AccountSpecApplyConfiguration constructs an declarative configuration of the AccountSpec type for use with @@ -54,3 +56,19 @@ func (b *AccountSpecApplyConfiguration) WithCreds(value *CredsSecretApplyConfigu b.Creds = value return b } + +// WithToken sets the Token field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Token field is set to the value of the last call. +func (b *AccountSpecApplyConfiguration) WithToken(value *TokenSecretApplyConfiguration) *AccountSpecApplyConfiguration { + b.Token = value + return b +} + +// WithUserWithPassword sets the UserWithPassword field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UserWithPassword field is set to the value of the last call. +func (b *AccountSpecApplyConfiguration) WithUserWithPassword(value *UserWithPasswordApplyConfiguration) *AccountSpecApplyConfiguration { + b.UserWithPassword = value + return b +} diff --git a/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/tokensecret.go b/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/tokensecret.go new file mode 100644 index 00000000..4ca03c17 --- /dev/null +++ b/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/tokensecret.go @@ -0,0 +1,45 @@ +// Copyright 2020 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// TokenSecretApplyConfiguration represents an declarative configuration of the TokenSecret type for use +// with apply. +type TokenSecretApplyConfiguration struct { + Token *string `json:"token,omitempty"` + Secret *SecretRefApplyConfiguration `json:"secret,omitempty"` +} + +// TokenSecretApplyConfiguration constructs an declarative configuration of the TokenSecret type for use with +// apply. +func TokenSecret() *TokenSecretApplyConfiguration { + return &TokenSecretApplyConfiguration{} +} + +// WithToken sets the Token field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Token field is set to the value of the last call. +func (b *TokenSecretApplyConfiguration) WithToken(value string) *TokenSecretApplyConfiguration { + b.Token = &value + return b +} + +// WithSecret sets the Secret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Secret field is set to the value of the last call. +func (b *TokenSecretApplyConfiguration) WithSecret(value *SecretRefApplyConfiguration) *TokenSecretApplyConfiguration { + b.Secret = value + return b +} diff --git a/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/userwithpassword.go b/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/userwithpassword.go new file mode 100644 index 00000000..c4441c14 --- /dev/null +++ b/pkg/jetstream/generated/applyconfiguration/jetstream/v1beta2/userwithpassword.go @@ -0,0 +1,54 @@ +// Copyright 2020 The NATS Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta2 + +// UserWithPasswordApplyConfiguration represents an declarative configuration of the UserWithPassword type for use +// with apply. +type UserWithPasswordApplyConfiguration struct { + User *string `json:"user,omitempty"` + Password *string `json:"password,omitempty"` + Secret *SecretRefApplyConfiguration `json:"secret,omitempty"` +} + +// UserWithPasswordApplyConfiguration constructs an declarative configuration of the UserWithPassword type for use with +// apply. +func UserWithPassword() *UserWithPasswordApplyConfiguration { + return &UserWithPasswordApplyConfiguration{} +} + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *UserWithPasswordApplyConfiguration) WithUser(value string) *UserWithPasswordApplyConfiguration { + b.User = &value + return b +} + +// WithPassword sets the Password field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Password field is set to the value of the last call. +func (b *UserWithPasswordApplyConfiguration) WithPassword(value string) *UserWithPasswordApplyConfiguration { + b.Password = &value + return b +} + +// WithSecret sets the Secret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Secret field is set to the value of the last call. +func (b *UserWithPasswordApplyConfiguration) WithSecret(value *SecretRefApplyConfiguration) *UserWithPasswordApplyConfiguration { + b.Secret = value + return b +} diff --git a/pkg/jetstream/generated/applyconfiguration/utils.go b/pkg/jetstream/generated/applyconfiguration/utils.go index 4e1751e0..17616aeb 100644 --- a/pkg/jetstream/generated/applyconfiguration/utils.go +++ b/pkg/jetstream/generated/applyconfiguration/utils.go @@ -58,6 +58,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &jetstreamv1beta2.TLSApplyConfiguration{} case v1beta2.SchemeGroupVersion.WithKind("TLSSecret"): return &jetstreamv1beta2.TLSSecretApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("TokenSecret"): + return &jetstreamv1beta2.TokenSecretApplyConfiguration{} + case v1beta2.SchemeGroupVersion.WithKind("UserWithPassword"): + return &jetstreamv1beta2.UserWithPasswordApplyConfiguration{} } return nil