mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Fix typos (#1905)
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com> Signed-off-by: Christian Mesh <christianmesh1@gmail.com> Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
parent
ffeded20a4
commit
ea558d9d4b
@ -8,7 +8,7 @@ ENHANCEMENTS:
|
||||
* Added `-show-sensitive` flag to tofu plan, apply, state-show and output commands to display sensitive data in output. ([#1554](https://github.com/opentofu/opentofu/pull/1554))
|
||||
* Improved performance for large graphs when debug logs are not enabled. ([#1810](https://github.com/opentofu/opentofu/pull/1810))
|
||||
* Improved performance for large graphs with many submodules. ([#1809](https://github.com/opentofu/opentofu/pull/1809))
|
||||
* Added mutli-line support to the `tofu console` command. ([#1307](https://github.com/opentofu/opentofu/issues/1307))
|
||||
* Added multi-line support to the `tofu console` command. ([#1307](https://github.com/opentofu/opentofu/issues/1307))
|
||||
* Added a help target to the Makefile. ([#1925](https://github.com/opentofu/opentofu/pull/1925))
|
||||
* Added a simplified Build Process with a Makefile Target ([#1926](https://github.com/opentofu/opentofu/issues/1926))
|
||||
|
||||
|
@ -666,7 +666,7 @@ TSC:
|
||||
|
||||
#### IBM acquisition of Hashicorp
|
||||
|
||||
Shall we publish anything as OpenTofu regarding the acquision?
|
||||
Shall we publish anything as OpenTofu regarding the acquisition?
|
||||
|
||||
##### Discussion/Decision
|
||||
|
||||
|
@ -66,7 +66,7 @@ Hello there! After the 1.7.1 release last week, the core team has been focusing
|
||||
|
||||
- Current Status
|
||||
- [Init-time constant evaluation](https://github.com/opentofu/opentofu/issues/1042)
|
||||
- Initial [discussion and planning](https://github.com/opentofu/opentofu/pull/1649) are happening as an extension of the RFC proces
|
||||
- Initial [discussion and planning](https://github.com/opentofu/opentofu/pull/1649) are happening as an extension of the RFC process
|
||||
- [Registry UI](https://github.com/opentofu/registry/issues/450)
|
||||
- Designs and prototyping are in progress!
|
||||
- [Releases page with direct links to artifacts](https://github.com/opentofu/get.opentofu.org/pull/25) is now live https://get.opentofu.org/tofu/api.json
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 5 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 5 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 5 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 5 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 6 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 6 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 6 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 6 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 6 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -10,7 +10,7 @@
|
||||
// use protoc to generate stubs for your target language.
|
||||
//
|
||||
// This file will not be updated. Any minor versions of protocol 6 to follow
|
||||
// should copy this file and modify the copy while maintaing backwards
|
||||
// should copy this file and modify the copy while maintaining backwards
|
||||
// compatibility. Breaking changes, if any are required, will come
|
||||
// in a subsequent major version with its own separate proto definition.
|
||||
//
|
||||
|
@ -51,7 +51,7 @@ func ParseInstanceKey(key cty.Value) (InstanceKey, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// NoKey represents the absense of an InstanceKey, for the single instance
|
||||
// NoKey represents the absence of an InstanceKey, for the single instance
|
||||
// of a configuration object that does not use "count" or "for_each" at all.
|
||||
var NoKey InstanceKey
|
||||
|
||||
|
@ -144,7 +144,7 @@ func (m Module) Parent() Module {
|
||||
// In practice, this just turns the last element of the receiver into a
|
||||
// ModuleCall and then returns a slice of the receiever that excludes that
|
||||
// last part. This is just a convenience for situations where a call address
|
||||
// is required, such as when dealing with *Reference and Referencable values.
|
||||
// is required, such as when dealing with *Reference and Referenceable values.
|
||||
func (m Module) Call() (Module, ModuleCall) {
|
||||
if len(m) == 0 {
|
||||
panic("cannot produce ModuleCall for root module")
|
||||
|
@ -128,7 +128,7 @@ func (c ModuleCallInstance) Absolute(moduleAddr ModuleInstance) ModuleInstance {
|
||||
|
||||
// ModuleInstance returns the address of the module instance that corresponds
|
||||
// to the receiving call instance when resolved in the given calling module.
|
||||
// In other words, it returns the child module instance that the receving
|
||||
// In other words, it returns the child module instance that the receiving
|
||||
// call instance creates.
|
||||
func (c ModuleCallInstance) ModuleInstance(caller ModuleInstance) ModuleInstance {
|
||||
return caller.Child(c.Call.Name, c.Key)
|
||||
@ -189,7 +189,7 @@ func (co ModuleCallInstanceOutput) UniqueKey() UniqueKey {
|
||||
func (co ModuleCallInstanceOutput) uniqueKeySigil() {}
|
||||
|
||||
// AbsOutputValue returns the absolute output value address that corresponds
|
||||
// to the receving module call output address, once resolved in the given
|
||||
// to the receiving module call output address, once resolved in the given
|
||||
// calling module.
|
||||
func (co ModuleCallInstanceOutput) AbsOutputValue(caller ModuleInstance) AbsOutputValue {
|
||||
moduleAddr := co.Call.ModuleInstance(caller)
|
||||
|
@ -346,7 +346,7 @@ func (m ModuleInstance) IsAncestor(o ModuleInstance) bool {
|
||||
// In practice, this just turns the last element of the receiver into a
|
||||
// ModuleCall and then returns a slice of the receiever that excludes that
|
||||
// last part. This is just a convenience for situations where a call address
|
||||
// is required, such as when dealing with *Reference and Referencable values.
|
||||
// is required, such as when dealing with *Reference and Referenceable values.
|
||||
func (m ModuleInstance) Call() (ModuleInstance, ModuleCall) {
|
||||
if len(m) == 0 {
|
||||
panic("cannot produce ModuleCall for root module")
|
||||
@ -368,7 +368,7 @@ func (m ModuleInstance) Call() (ModuleInstance, ModuleCall) {
|
||||
// In practice, this just turns the last element of the receiver into a
|
||||
// ModuleCallInstance and then returns a slice of the receiever that excludes
|
||||
// that last part. This is just a convenience for situations where a call\
|
||||
// address is required, such as when dealing with *Reference and Referencable
|
||||
// address is required, such as when dealing with *Reference and Referenceable
|
||||
// values.
|
||||
func (m ModuleInstance) CallInstance() (ModuleInstance, ModuleCallInstance) {
|
||||
if len(m) == 0 {
|
||||
@ -387,7 +387,7 @@ func (m ModuleInstance) CallInstance() (ModuleInstance, ModuleCallInstance) {
|
||||
// TargetContains implements Targetable by returning true if the given other
|
||||
// address either matches the receiver, is a sub-module-instance of the
|
||||
// receiver, or is a targetable absolute address within a module that
|
||||
// is contained within the reciever.
|
||||
// is contained within the receiver.
|
||||
func (m ModuleInstance) TargetContains(other Targetable) bool {
|
||||
switch to := other.(type) {
|
||||
case Module:
|
||||
|
@ -123,7 +123,7 @@ func ParseModuleSource(raw string) (ModuleSource, error) {
|
||||
// and then create relative references within the same directory in order
|
||||
// to ensure all modules in the package are looking at a consistent filesystem
|
||||
// layout. We also assume that modules within a package are maintained together,
|
||||
// which means that cross-cutting maintenence across all of them would be
|
||||
// which means that cross-cutting maintenance across all of them would be
|
||||
// possible.
|
||||
//
|
||||
// The actual value of a ModuleSourceLocal is a normalized relative path using
|
||||
@ -163,7 +163,7 @@ func parseModuleSourceLocal(raw string) (ModuleSourceLocal, error) {
|
||||
clean := path.Clean(raw)
|
||||
|
||||
// However, we do need to keep a single "./" on the front if it isn't
|
||||
// a "../" path, or else it would be ambigous with the registry address
|
||||
// a "../" path, or else it would be ambiguous with the registry address
|
||||
// syntax.
|
||||
if !strings.HasPrefix(clean, "../") {
|
||||
clean = "./" + clean
|
||||
@ -355,7 +355,7 @@ func (s ModuleSourceRemote) ForDisplay() string {
|
||||
// given path are both respected.
|
||||
//
|
||||
// This will return nonsense if given a registry address other than the one
|
||||
// that generated the reciever via a registry lookup.
|
||||
// that generated the receiver via a registry lookup.
|
||||
func (s ModuleSourceRemote) FromRegistry(given ModuleSourceRegistry) ModuleSourceRemote {
|
||||
ret := s // not a pointer, so this is a shallow copy
|
||||
|
||||
|
@ -368,7 +368,7 @@ func TestModuleSourceRemoteFromRegistry(t *testing.T) {
|
||||
}
|
||||
gotAddr := remote.FromRegistry(registry)
|
||||
if remote.Subdir != "foo" {
|
||||
t.Errorf("FromRegistry modified the reciever; should be pure function")
|
||||
t.Errorf("FromRegistry modified the receiver; should be pure function")
|
||||
}
|
||||
if registry.Subdir != "bar" {
|
||||
t.Errorf("FromRegistry modified the given address; should be pure function")
|
||||
@ -387,7 +387,7 @@ func TestModuleSourceRemoteFromRegistry(t *testing.T) {
|
||||
}
|
||||
gotAddr := remote.FromRegistry(registry)
|
||||
if remote.Subdir != "foo" {
|
||||
t.Errorf("FromRegistry modified the reciever; should be pure function")
|
||||
t.Errorf("FromRegistry modified the receiver; should be pure function")
|
||||
}
|
||||
if registry.Subdir != "" {
|
||||
t.Errorf("FromRegistry modified the given address; should be pure function")
|
||||
@ -406,7 +406,7 @@ func TestModuleSourceRemoteFromRegistry(t *testing.T) {
|
||||
}
|
||||
gotAddr := remote.FromRegistry(registry)
|
||||
if remote.Subdir != "" {
|
||||
t.Errorf("FromRegistry modified the reciever; should be pure function")
|
||||
t.Errorf("FromRegistry modified the receiver; should be pure function")
|
||||
}
|
||||
if registry.Subdir != "bar" {
|
||||
t.Errorf("FromRegistry modified the given address; should be pure function")
|
||||
|
@ -72,7 +72,7 @@ func (e *MoveEndpoint) Equal(other *MoveEndpoint) bool {
|
||||
}
|
||||
|
||||
// MightUnifyWith returns true if it is possible that a later call to
|
||||
// UnifyMoveEndpoints might succeed if given the reciever and the other
|
||||
// UnifyMoveEndpoints might succeed if given the receiver and the other
|
||||
// given endpoint.
|
||||
//
|
||||
// This is intended for early static validation of obviously-wrong situations,
|
||||
@ -86,7 +86,7 @@ func (e *MoveEndpoint) MightUnifyWith(other *MoveEndpoint) bool {
|
||||
return from != nil && to != nil
|
||||
}
|
||||
|
||||
// ConfigMovable transforms the reciever into a ConfigMovable by resolving it
|
||||
// ConfigMovable transforms the receiver into a ConfigMovable by resolving it
|
||||
// relative to the given base module, which should be the module where
|
||||
// the MoveEndpoint expression was found.
|
||||
//
|
||||
|
@ -84,7 +84,7 @@ func (e *MoveEndpointInModule) ObjectKind() MoveEndpointKind {
|
||||
}
|
||||
|
||||
// String produces a string representation of the object matching pattern
|
||||
// represented by the reciever.
|
||||
// represented by the receiver.
|
||||
//
|
||||
// Since there is no direct syntax for representing such an object matching
|
||||
// pattern, this function uses a splat-operator-like representation to stand
|
||||
@ -113,7 +113,7 @@ func (e *MoveEndpointInModule) String() string {
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// Equal returns true if the reciever represents the same matching pattern
|
||||
// Equal returns true if the receiver represents the same matching pattern
|
||||
// as the other given endpoint, ignoring the source location information.
|
||||
//
|
||||
// This is not an optimized function and is here primarily to help with
|
||||
@ -245,7 +245,7 @@ func (e *MoveEndpointInModule) synthModuleInstance() ModuleInstance {
|
||||
return inst
|
||||
}
|
||||
|
||||
// SelectsModule returns true if the reciever directly selects either
|
||||
// SelectsModule returns true if the receiver directly selects either
|
||||
// the given module or a resource nested directly inside that module.
|
||||
//
|
||||
// This is a good function to use to decide which modules in a state
|
||||
@ -331,11 +331,11 @@ func moduleInstanceCanMatch(modA, modB ModuleInstance) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// CanChainFrom returns true if the reciever describes an address that could
|
||||
// CanChainFrom returns true if the receiver describes an address that could
|
||||
// potentially select an object that the other given address could select.
|
||||
//
|
||||
// In other words, this decides whether the move chaining rule applies, if
|
||||
// the reciever is the "to" from one statement and the other given address
|
||||
// the receiver is the "to" from one statement and the other given address
|
||||
// is the "from" of another statement.
|
||||
func (e *MoveEndpointInModule) CanChainFrom(other *MoveEndpointInModule) bool {
|
||||
eMod := e.synthModuleInstance()
|
||||
@ -490,7 +490,7 @@ func (m ModuleInstance) MoveDestination(fromMatch, toMatch *MoveEndpointInModule
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// The rest of our work will be against the part of the reciever that's
|
||||
// The rest of our work will be against the part of the receiver that's
|
||||
// relative to the declaration module. mRel is a weird abuse of
|
||||
// ModuleInstance that represents a relative module address, similar to
|
||||
// what we do for MoveEndpointInModule.relSubject.
|
||||
@ -584,7 +584,7 @@ func (r AbsResource) MoveDestination(fromMatch, toMatch *MoveEndpointInModule) (
|
||||
return AbsResource{}, false
|
||||
}
|
||||
|
||||
// fromMatch can only possibly match the reciever if the resource
|
||||
// fromMatch can only possibly match the receiver if the resource
|
||||
// portions are identical, regardless of the module paths.
|
||||
if fromRelSubject.Resource != r.Resource {
|
||||
return AbsResource{}, false
|
||||
@ -666,7 +666,7 @@ func (r AbsResourceInstance) MoveDestination(fromMatch, toMatch *MoveEndpointInM
|
||||
return AbsResourceInstance{}, false
|
||||
}
|
||||
|
||||
// fromMatch can only possibly match the reciever if the resource
|
||||
// fromMatch can only possibly match the receiver if the resource
|
||||
// portions are identical, regardless of the module paths.
|
||||
if fromRelSubject.Resource != r.Resource {
|
||||
return AbsResourceInstance{}, false
|
||||
|
@ -286,7 +286,7 @@ func TestModuleInstanceMoveDestination(t *testing.T) {
|
||||
var diags tfdiags.Diagnostics
|
||||
receiverAddr, diags = ParseModuleInstanceStr(test.Receiver)
|
||||
if diags.HasErrors() {
|
||||
t.Fatalf("invalid reciever address: %s", diags.Err().Error())
|
||||
t.Fatalf("invalid receiver address: %s", diags.Err().Error())
|
||||
}
|
||||
}
|
||||
gotAddr, gotMatch := receiverAddr.MoveDestination(fromEP, toEP)
|
||||
@ -394,7 +394,7 @@ func TestAbsResourceInstanceMoveDestination(t *testing.T) {
|
||||
`test_object.beep`,
|
||||
`test_object.boop`,
|
||||
`test_object.boop`,
|
||||
false, // the reciever is already the "to" address
|
||||
false, // the receiver is already the "to" address
|
||||
``,
|
||||
},
|
||||
{
|
||||
@ -684,7 +684,7 @@ func TestAbsResourceInstanceMoveDestination(t *testing.T) {
|
||||
|
||||
receiverAddr, diags := ParseAbsResourceInstanceStr(test.Receiver)
|
||||
if diags.HasErrors() {
|
||||
t.Fatalf("invalid reciever address: %s", diags.Err().Error())
|
||||
t.Fatalf("invalid receiver address: %s", diags.Err().Error())
|
||||
}
|
||||
gotAddr, gotMatch := receiverAddr.MoveDestination(fromEP, toEP)
|
||||
if !test.WantMatch {
|
||||
@ -767,7 +767,7 @@ func TestAbsResourceMoveDestination(t *testing.T) {
|
||||
`test_object.beep`,
|
||||
`test_object.boop`,
|
||||
`test_object.boop`,
|
||||
false, // the reciever is already the "to" address
|
||||
false, // the receiver is already the "to" address
|
||||
``,
|
||||
},
|
||||
{
|
||||
@ -1054,10 +1054,10 @@ func TestAbsResourceMoveDestination(t *testing.T) {
|
||||
// key.
|
||||
receiverInstanceAddr, diags := ParseAbsResourceInstanceStr(test.Receiver)
|
||||
if diags.HasErrors() {
|
||||
t.Fatalf("invalid reciever address: %s", diags.Err().Error())
|
||||
t.Fatalf("invalid receiver address: %s", diags.Err().Error())
|
||||
}
|
||||
if receiverInstanceAddr.Resource.Key != NoKey {
|
||||
t.Fatalf("invalid reciever address: must be a resource, not a resource instance")
|
||||
t.Fatalf("invalid receiver address: must be a resource, not a resource instance")
|
||||
}
|
||||
receiverAddr := receiverInstanceAddr.ContainingResource()
|
||||
gotAddr, gotMatch := receiverAddr.MoveDestination(fromEP, toEP)
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
//
|
||||
// This is related to but separate from ModuleCallOutput, which represents
|
||||
// a module output from the perspective of its parent module. Outputs are
|
||||
// referencable from the testing scope, in general tofu operation users
|
||||
// referenceable from the testing scope, in general tofu operation users
|
||||
// will be referencing ModuleCallOutput.
|
||||
type OutputValue struct {
|
||||
referenceable
|
||||
|
@ -25,7 +25,7 @@ type Reference struct {
|
||||
}
|
||||
|
||||
// DisplayString returns a string that approximates the subject and remaining
|
||||
// traversal of the reciever in a way that resembles the OpenTofu language
|
||||
// traversal of the receiver in a way that resembles the OpenTofu language
|
||||
// syntax that could've produced it.
|
||||
//
|
||||
// It's not guaranteed to actually be a valid OpenTofu language expression,
|
||||
@ -61,7 +61,7 @@ func (r *Reference) DisplayString() string {
|
||||
return ret.String()
|
||||
}
|
||||
|
||||
// ParseRef attempts to extract a referencable address from the prefix of the
|
||||
// ParseRef attempts to extract a referenceable address from the prefix of the
|
||||
// given traversal, which must be an absolute traversal or this function
|
||||
// will panic.
|
||||
//
|
||||
|
@ -405,7 +405,7 @@ func ParseAbsResourceInstanceStr(str string) (AbsResourceInstance, tfdiags.Diagn
|
||||
}
|
||||
|
||||
// ModuleAddr returns the module address portion of the subject of
|
||||
// the recieving target.
|
||||
// the receiving target.
|
||||
//
|
||||
// Regardless of specific address type, all targets always include
|
||||
// a module address. They might also include something in that
|
||||
|
@ -35,7 +35,7 @@ import (
|
||||
//
|
||||
// Recipients of a ProviderConfig value can assume it can contain only a
|
||||
// LocalProviderConfig value, an AbsProviderConfigValue, or nil to represent
|
||||
// the absense of a provider config in situations where that is meaningful.
|
||||
// the absence of a provider config in situations where that is meaningful.
|
||||
type ProviderConfig interface {
|
||||
providerConfig()
|
||||
}
|
||||
@ -325,7 +325,7 @@ func ParseLegacyAbsProviderConfig(traversal hcl.Traversal) (AbsProviderConfig, t
|
||||
}
|
||||
|
||||
// ProviderConfigDefault returns the address of the default provider config of
|
||||
// the given type inside the recieving module instance.
|
||||
// the given type inside the receiving module instance.
|
||||
func (m ModuleInstance) ProviderConfigDefault(provider Provider) AbsProviderConfig {
|
||||
return AbsProviderConfig{
|
||||
Module: m.Module(),
|
||||
@ -334,7 +334,7 @@ func (m ModuleInstance) ProviderConfigDefault(provider Provider) AbsProviderConf
|
||||
}
|
||||
|
||||
// ProviderConfigAliased returns the address of an aliased provider config of
|
||||
// the given type and alias inside the recieving module instance.
|
||||
// the given type and alias inside the receiving module instance.
|
||||
func (m ModuleInstance) ProviderConfigAliased(provider Provider, alias string) AbsProviderConfig {
|
||||
return AbsProviderConfig{
|
||||
Module: m.Module(),
|
||||
@ -351,7 +351,7 @@ func (pc AbsProviderConfig) providerConfig() {}
|
||||
// such inheritance is possible, and thus whether the returned address is valid.
|
||||
//
|
||||
// Inheritance is possible only for default (un-aliased) providers in modules
|
||||
// other than the root module. Even if a valid address is returned, inheritence
|
||||
// other than the root module. Even if a valid address is returned, inheritance
|
||||
// may not be performed for other reasons, such as if the calling module
|
||||
// provided explicit provider configurations within the call for this module.
|
||||
// The ProviderTransformer graph transform in the main tofu module has the
|
||||
|
@ -63,7 +63,7 @@ func (r Resource) UniqueKey() UniqueKey {
|
||||
func (r Resource) uniqueKeySigil() {}
|
||||
|
||||
// Instance produces the address for a specific instance of the receiver
|
||||
// that is idenfied by the given key.
|
||||
// that is identified by the given key.
|
||||
func (r Resource) Instance(key InstanceKey) ResourceInstance {
|
||||
return ResourceInstance{
|
||||
Resource: r,
|
||||
@ -171,7 +171,7 @@ func (m ModuleInstance) Resource(mode ResourceMode, typeName string, name string
|
||||
}
|
||||
|
||||
// Instance produces the address for a specific instance of the receiver
|
||||
// that is idenfied by the given key.
|
||||
// that is identified by the given key.
|
||||
func (r AbsResource) Instance(key InstanceKey) AbsResourceInstance {
|
||||
return AbsResourceInstance{
|
||||
Module: r.Module,
|
||||
@ -279,7 +279,7 @@ func (m ModuleInstance) ResourceInstance(mode ResourceMode, typeName string, nam
|
||||
}
|
||||
|
||||
// ContainingResource returns the address of the resource that contains the
|
||||
// receving resource instance. In other words, it discards the key portion
|
||||
// receiving resource instance. In other words, it discards the key portion
|
||||
// of the address to produce an AbsResource value.
|
||||
func (r AbsResourceInstance) ContainingResource() AbsResource {
|
||||
return AbsResource{
|
||||
|
@ -12,7 +12,7 @@ import "fmt"
|
||||
// non-primary state.
|
||||
//
|
||||
// Graph nodes can declare themselves referenceable via an instance phase
|
||||
// or can declare that they reference an instance phase in order to accomodate
|
||||
// or can declare that they reference an instance phase in order to accommodate
|
||||
// secondary graph nodes dealing with, for example, destroy actions.
|
||||
//
|
||||
// This special reference type cannot be accessed directly by end-users, and
|
||||
@ -25,7 +25,7 @@ type ResourceInstancePhase struct {
|
||||
|
||||
var _ Referenceable = ResourceInstancePhase{}
|
||||
|
||||
// Phase returns a special "phase address" for the receving instance. See the
|
||||
// Phase returns a special "phase address" for the receiving instance. See the
|
||||
// documentation of ResourceInstancePhase for the limited situations where this
|
||||
// is intended to be used.
|
||||
func (r ResourceInstance) Phase(rpt ResourceInstancePhaseType) ResourceInstancePhase {
|
||||
@ -78,7 +78,7 @@ func (rpt ResourceInstancePhaseType) String() string {
|
||||
// non-primary state.
|
||||
//
|
||||
// Graph nodes can declare themselves referenceable via a resource phase
|
||||
// or can declare that they reference a resource phase in order to accomodate
|
||||
// or can declare that they reference a resource phase in order to accommodate
|
||||
// secondary graph nodes dealing with, for example, destroy actions.
|
||||
//
|
||||
// Since resources (as opposed to instances) aren't actually phased, this
|
||||
@ -97,7 +97,7 @@ type ResourcePhase struct {
|
||||
|
||||
var _ Referenceable = ResourcePhase{}
|
||||
|
||||
// Phase returns a special "phase address" for the receving instance. See the
|
||||
// Phase returns a special "phase address" for the receiving instance. See the
|
||||
// documentation of ResourceInstancePhase for the limited situations where this
|
||||
// is intended to be used.
|
||||
func (r Resource) Phase(rpt ResourceInstancePhaseType) ResourcePhase {
|
||||
|
@ -242,7 +242,7 @@ func TestAbsResourceUniqueKey(t *testing.T) {
|
||||
}.Absolute(RootModuleInstance.Child("boop", NoKey))
|
||||
|
||||
tests := []struct {
|
||||
Reciever AbsResource
|
||||
Receiver AbsResource
|
||||
Other UniqueKeyer
|
||||
WantEqual bool
|
||||
}{
|
||||
@ -279,15 +279,15 @@ func TestAbsResourceUniqueKey(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(fmt.Sprintf("%s matches %T %s?", test.Reciever, test.Other, test.Other), func(t *testing.T) {
|
||||
rKey := test.Reciever.UniqueKey()
|
||||
t.Run(fmt.Sprintf("%s matches %T %s?", test.Receiver, test.Other, test.Other), func(t *testing.T) {
|
||||
rKey := test.Receiver.UniqueKey()
|
||||
oKey := test.Other.UniqueKey()
|
||||
|
||||
gotEqual := rKey == oKey
|
||||
if gotEqual != test.WantEqual {
|
||||
t.Errorf(
|
||||
"wrong result\nreceiver: %s\nother: %s (%T)\ngot: %t\nwant: %t",
|
||||
test.Reciever, test.Other, test.Other,
|
||||
test.Receiver, test.Other, test.Other,
|
||||
gotEqual, test.WantEqual,
|
||||
)
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ func (s Set[T]) Remove(addr T) {
|
||||
}
|
||||
|
||||
// Union returns a new set which contains the union of all of the elements
|
||||
// of both the reciever and the given other set.
|
||||
// of both the receiver and the given other set.
|
||||
func (s Set[T]) Union(other Set[T]) Set[T] {
|
||||
ret := make(Set[T])
|
||||
for k, addr := range s {
|
||||
@ -55,7 +55,7 @@ func (s Set[T]) Union(other Set[T]) Set[T] {
|
||||
}
|
||||
|
||||
// Intersection returns a new set which contains the intersection of all of the
|
||||
// elements of both the reciever and the given other set.
|
||||
// elements of both the receiver and the given other set.
|
||||
func (s Set[T]) Intersection(other Set[T]) Set[T] {
|
||||
ret := make(Set[T])
|
||||
for k, addr := range s {
|
||||
|
@ -126,7 +126,7 @@ func (b deprecatedBackendShim) PrepareConfig(obj cty.Value) (cty.Value, tfdiags.
|
||||
return newObj, diags.Append(tfdiags.SimpleWarning(b.Message))
|
||||
}
|
||||
|
||||
// DeprecateBackend can be used to wrap a backend to retrun a deprecation
|
||||
// DeprecateBackend can be used to wrap a backend to return a deprecation
|
||||
// warning during validation.
|
||||
func deprecateBackend(b backend.Backend, message string) backend.Backend {
|
||||
// Since a Backend wrapped by deprecatedBackendShim can no longer be
|
||||
|
@ -309,7 +309,7 @@ func (b *Local) Operation(ctx context.Context, op *backend.Operation) (*backend.
|
||||
b.opLock.Lock()
|
||||
|
||||
// Build our running operation
|
||||
// the runninCtx is only used to block until the operation returns.
|
||||
// the runningCtx is only used to block until the operation returns.
|
||||
runningCtx, done := context.WithCancel(context.Background())
|
||||
runningOp := &backend.RunningOperation{
|
||||
Context: runningCtx,
|
||||
|
@ -85,7 +85,7 @@ func (b *Local) opPlan(
|
||||
op.ReportResult(runningOp, diags)
|
||||
return
|
||||
}
|
||||
// the state was locked during succesfull context creation; unlock the state
|
||||
// the state was locked during successful context creation; unlock the state
|
||||
// when the operation completes
|
||||
defer func() {
|
||||
diags := op.StateLocker.Unlock()
|
||||
|
@ -162,7 +162,7 @@ type IntermediateStateConditionalPersister interface {
|
||||
// emits an intermediate state event that is potentially eligible to be
|
||||
// persisted.
|
||||
//
|
||||
// The implemention should return true to signal that the state snapshot
|
||||
// The implementation should return true to signal that the state snapshot
|
||||
// most recently provided to the object's WriteState should be persisted,
|
||||
// or false if it should not be persisted. If this function returns true
|
||||
// then the receiver will see a subsequent call to
|
||||
|
@ -130,7 +130,7 @@ func (c *RemoteClient) Put(data []byte) error {
|
||||
// and whether the user enabled gzip:
|
||||
// - single entry mode with plain JSON: a single JSON is stored at
|
||||
// "tfstate/my_project"
|
||||
// - single entry mode gzip: the JSON payload is first gziped and stored at
|
||||
// - single entry mode gzip: the JSON payload is first gzipped and stored at
|
||||
// "tfstate/my_project"
|
||||
// - chunked mode with plain JSON: the JSON payload is split in pieces and
|
||||
// stored like so:
|
||||
@ -147,10 +147,10 @@ func (c *RemoteClient) Put(data []byte) error {
|
||||
// - "tfstate/my_project/tfstate.abcdef1234/0" -> The first chunk
|
||||
// - "tfstate/my_project/tfstate.abcdef1234/1" -> The next one
|
||||
// - ...
|
||||
// - chunked mode with gzip: the same system but we gziped the JSON payload
|
||||
// - chunked mode with gzip: the same system but we gzipped the JSON payload
|
||||
// before splitting it in chunks
|
||||
//
|
||||
// When overwritting the current state, we need to clean the old chunks if
|
||||
// When overwriting the current state, we need to clean the old chunks if
|
||||
// we were in chunked mode (no matter whether we need to use chunks for the
|
||||
// new one). To do so based on the 4 possibilities above we look at the
|
||||
// value at "tfstate/my_project" and if it is:
|
||||
@ -674,7 +674,7 @@ func (c *RemoteClient) chunkedMode() (bool, string, []string, *consulapi.KVPair,
|
||||
var d map[string]interface{}
|
||||
err = json.Unmarshal(pair.Value, &d)
|
||||
// If there is an error when unmarshaling the payload, the state has
|
||||
// probably been gziped in single entry mode.
|
||||
// probably been gzipped in single entry mode.
|
||||
if err == nil {
|
||||
// If we find the "current-hash" key we were in chunked mode
|
||||
hash, ok := d["current-hash"]
|
||||
|
@ -207,9 +207,9 @@ func TestConsul_largeState(t *testing.T) {
|
||||
c.Path = path
|
||||
|
||||
// We need a long random string so it results in multiple chunks even after
|
||||
// being gziped
|
||||
// being gzipped
|
||||
|
||||
// We use a fixed seed so the test can be reproductible
|
||||
// We use a fixed seed so the test can be reproducible
|
||||
randomizer := rand.New(rand.NewSource(1234))
|
||||
RandStringRunes := func(n int) string {
|
||||
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
|
||||
|
@ -341,7 +341,7 @@ func tryLoadingConfigFile(d *schema.ResourceData) (*restclient.Config, error) {
|
||||
authInfo, authInfoOk := d.GetOk("config_context_auth_info")
|
||||
cluster, clusterOk := d.GetOk("config_context_cluster")
|
||||
if ctxOk || authInfoOk || clusterOk {
|
||||
ctxSuffix = "; overriden context"
|
||||
ctxSuffix = "; overridden context"
|
||||
if ctxOk {
|
||||
overrides.CurrentContext = ctx.(string)
|
||||
ctxSuffix += fmt.Sprintf("; config ctx: %s", overrides.CurrentContext)
|
||||
@ -357,7 +357,7 @@ func tryLoadingConfigFile(d *schema.ResourceData) (*restclient.Config, error) {
|
||||
overrides.Context.Cluster = cluster.(string)
|
||||
ctxSuffix += fmt.Sprintf("; cluster: %s", overrides.Context.Cluster)
|
||||
}
|
||||
log.Printf("[DEBUG] Using overidden context: %#v", overrides.Context)
|
||||
log.Printf("[DEBUG] Using overridden context: %#v", overrides.Context)
|
||||
}
|
||||
|
||||
if v, ok := d.GetOk("exec"); ok {
|
||||
|
@ -1208,7 +1208,7 @@ func (e customEndpoint) String(obj cty.Value) string {
|
||||
return v
|
||||
}
|
||||
|
||||
func includeProtoIfNessesary(endpoint string) string {
|
||||
func includeProtoIfNecessary(endpoint string) string {
|
||||
if matched, _ := regexp.MatchString("[a-z]*://.*", endpoint); !matched {
|
||||
log.Printf("[DEBUG] Adding https:// prefix to endpoint '%s'", endpoint)
|
||||
endpoint = fmt.Sprintf("https://%s", endpoint)
|
||||
@ -1223,12 +1223,12 @@ func (e customEndpoint) StringOk(obj cty.Value) (string, bool) {
|
||||
continue
|
||||
}
|
||||
if s, ok := stringValueOk(val); ok {
|
||||
return includeProtoIfNessesary(s), true
|
||||
return includeProtoIfNecessary(s), true
|
||||
}
|
||||
}
|
||||
for _, envVar := range e.EnvVars {
|
||||
if v := os.Getenv(envVar); v != "" {
|
||||
return includeProtoIfNessesary(v), true
|
||||
return includeProtoIfNecessary(v), true
|
||||
}
|
||||
}
|
||||
return "", false
|
||||
|
@ -693,7 +693,7 @@ func TestBackendConfig_PrepareConfigValidation(t *testing.T) {
|
||||
}),
|
||||
expectedErr: `The "workspace_key_prefix" attribute value must not start with "/".`,
|
||||
},
|
||||
"encyrption key conflict": {
|
||||
"encryption key conflict": {
|
||||
config: cty.ObjectVal(map[string]cty.Value{
|
||||
"bucket": cty.StringVal("test"),
|
||||
"key": cty.StringVal("test"),
|
||||
@ -860,7 +860,7 @@ func TestBackendConfig_PrepareConfigWithEnvVars(t *testing.T) {
|
||||
"AWS_DEFAULT_REGION": "us-west-1",
|
||||
},
|
||||
},
|
||||
"encyrption key conflict": {
|
||||
"encryption key conflict": {
|
||||
config: cty.ObjectVal(map[string]cty.Value{
|
||||
"bucket": cty.StringVal("test"),
|
||||
"key": cty.StringVal("test"),
|
||||
@ -1530,7 +1530,7 @@ func Test_pathString(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBackend_includeProtoIfNessesary(t *testing.T) {
|
||||
func TestBackend_includeProtoIfNecessary(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
provided string
|
||||
@ -1565,7 +1565,7 @@ func TestBackend_includeProtoIfNessesary(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
result := includeProtoIfNessesary(test.provided)
|
||||
result := includeProtoIfNecessary(test.provided)
|
||||
if result != test.expected {
|
||||
t.Errorf("Expected: %s, Got: %s", test.expected, result)
|
||||
}
|
||||
|
@ -52,12 +52,12 @@ func TestValidateKMSKey(t *testing.T) {
|
||||
},
|
||||
},
|
||||
"non-kms arn": {
|
||||
in: "arn:aws:lamda:foo:bar:key/xyz",
|
||||
in: "arn:aws:lambda:foo:bar:key/xyz",
|
||||
expected: tfdiags.Diagnostics{
|
||||
tfdiags.AttributeValue(
|
||||
tfdiags.Error,
|
||||
"Invalid KMS Key ARN",
|
||||
`Value must be a valid KMS Key ARN, got "arn:aws:lamda:foo:bar:key/xyz"`,
|
||||
`Value must be a valid KMS Key ARN, got "arn:aws:lambda:foo:bar:key/xyz"`,
|
||||
path,
|
||||
),
|
||||
},
|
||||
|
@ -808,7 +808,7 @@ func (b *Remote) Operation(ctx context.Context, op *backend.Operation) (*backend
|
||||
b.opLock.Lock()
|
||||
|
||||
// Build our running operation
|
||||
// the runninCtx is only used to block until the operation returns.
|
||||
// the runningCtx is only used to block until the operation returns.
|
||||
runningCtx, done := context.WithCancel(context.Background())
|
||||
runningOp := &backend.RunningOperation{
|
||||
Context: runningCtx,
|
||||
@ -901,7 +901,7 @@ func (b *Remote) cancel(cancelCtx context.Context, op *backend.Operation, r *tfe
|
||||
}
|
||||
} else {
|
||||
if b.CLI != nil {
|
||||
// Insert a blank line to separate the ouputs.
|
||||
// Insert a blank line to separate the outputs.
|
||||
b.CLI.Output("")
|
||||
}
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ func (b *Remote) opApply(stopCtx, cancelCtx context.Context, op *backend.Operati
|
||||
}
|
||||
|
||||
// If we don't need to ask for confirmation, insert a blank
|
||||
// line to separate the ouputs.
|
||||
// line to separate the outputs.
|
||||
if w.AutoApply || !mustConfirm {
|
||||
if b.CLI != nil {
|
||||
b.CLI.Output("")
|
||||
|
@ -1140,7 +1140,7 @@ func TestRemote_applyLockTimeout(t *testing.T) {
|
||||
t.Fatalf("expected remote backend header in output: %s", output)
|
||||
}
|
||||
if !strings.Contains(output, "Lock timeout exceeded") {
|
||||
t.Fatalf("expected lock timout error in output: %s", output)
|
||||
t.Fatalf("expected lock timeout error in output: %s", output)
|
||||
}
|
||||
if strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
|
||||
t.Fatalf("unexpected plan summery in output: %s", output)
|
||||
@ -1408,7 +1408,7 @@ func TestRemote_applyPolicySoftFailAutoApproveSuccess(t *testing.T) {
|
||||
}
|
||||
|
||||
if run.PlanEmpty {
|
||||
t.Fatalf("expected plan to not be empty, plan opertion completed without error")
|
||||
t.Fatalf("expected plan to not be empty, plan operation completed without error")
|
||||
}
|
||||
|
||||
if len(input.answers) != 0 {
|
||||
@ -1422,7 +1422,7 @@ func TestRemote_applyPolicySoftFailAutoApproveSuccess(t *testing.T) {
|
||||
|
||||
output := b.CLI.(*cli.MockUi).OutputWriter.String()
|
||||
if !strings.Contains(output, "Sentinel Result: false") {
|
||||
t.Fatalf("expected policy check to be false, insead got: %s", output)
|
||||
t.Fatalf("expected policy check to be false, instead got: %s", output)
|
||||
}
|
||||
if !strings.Contains(output, "Apply complete!") {
|
||||
t.Fatalf("expected apply to be complete, instead got: %s", output)
|
||||
|
@ -73,7 +73,7 @@ func (b *Remote) waitForRun(stopCtx, cancelCtx context.Context, op *backend.Oper
|
||||
b.CLI.Output(b.Colorize().Color(fmt.Sprintf("Waiting for the %s to start...\n", opType)))
|
||||
}
|
||||
if i > 0 && b.CLI != nil {
|
||||
// Insert a blank line to separate the ouputs.
|
||||
// Insert a blank line to separate the outputs.
|
||||
b.CLI.Output("")
|
||||
}
|
||||
return r, nil
|
||||
@ -232,7 +232,7 @@ func (b *Remote) hasExplicitVariableValues(op *backend.Operation) bool {
|
||||
}
|
||||
|
||||
// We're intentionally ignoring the diagnostics here because validation
|
||||
// of the variable values is the responsibilty of the remote system. Our
|
||||
// of the variable values is the responsibility of the remote system. Our
|
||||
// goal here is just to make a best effort count of how many variable
|
||||
// values are coming from -var or -var-file CLI arguments so that we can
|
||||
// hint the user that those are not supported for remote operations.
|
||||
|
@ -294,7 +294,7 @@ func (v *remoteStoredVariableValue) ParseVariableValue(mode configs.VariablePars
|
||||
// We mark these as "from input" with the rationale that entering
|
||||
// variable values into the Terraform Cloud or Enterprise UI is,
|
||||
// roughly speaking, a similar idea to entering variable values at
|
||||
// the interactive CLI prompts. It's not a perfect correspondance,
|
||||
// the interactive CLI prompts. It's not a perfect correspondence,
|
||||
// but it's closer than the other options.
|
||||
SourceType: tofu.ValueFromInput,
|
||||
}, diags
|
||||
|
@ -355,7 +355,7 @@ in order to capture the filesystem context the remote workspace expects:
|
||||
b.CLI.Output(b.Colorize().Color(strings.TrimSpace(lockTimeoutErr)))
|
||||
}
|
||||
|
||||
// We abuse the auto aprove flag to indicate that we do not
|
||||
// We abuse the auto approve flag to indicate that we do not
|
||||
// want to ask if the remote operation should be canceled.
|
||||
op.AutoApprove = true
|
||||
|
||||
|
@ -888,7 +888,7 @@ func TestRemote_planLockTimeout(t *testing.T) {
|
||||
t.Fatalf("expected remote backend header in output: %s", output)
|
||||
}
|
||||
if !strings.Contains(output, "Lock timeout exceeded") {
|
||||
t.Fatalf("expected lock timout error in output: %s", output)
|
||||
t.Fatalf("expected lock timeout error in output: %s", output)
|
||||
}
|
||||
if strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
|
||||
t.Fatalf("unexpected plan summary in output: %s", output)
|
||||
|
@ -134,7 +134,7 @@ func ParseDeclaredVariableValues(vv map[string]UnparsedVariableValue, decls map[
|
||||
return ret, diags
|
||||
}
|
||||
|
||||
// Checks all given tofu.InputValues variable maps for the existance of
|
||||
// Checks all given tofu.InputValues variable maps for the existence of
|
||||
// a named variable
|
||||
func isDefinedAny(name string, maps ...tofu.InputValues) bool {
|
||||
for _, m := range maps {
|
||||
|
@ -89,7 +89,7 @@ func NewState(config *configs.Config) *State {
|
||||
}
|
||||
|
||||
// ConfigHasChecks returns true if and only if the given address refers to
|
||||
// a configuration object that this State object is expecting to recieve
|
||||
// a configuration object that this State object is expecting to receive
|
||||
// statuses for.
|
||||
//
|
||||
// Other methods of Checks will typically panic if given a config address
|
||||
|
@ -37,7 +37,7 @@ const (
|
||||
// StatusError represents that OpenTofu Core tried to evaluate the check's
|
||||
// condition but encountered an error while evaluating the check expression.
|
||||
//
|
||||
// This is different than StatusFail because StatusFail indiciates that
|
||||
// This is different than StatusFail because StatusFail indicates that
|
||||
// the condition was valid and returned false, whereas StatusError
|
||||
// indicates that the condition was not valid at all.
|
||||
StatusError Status = 'E'
|
||||
|
@ -832,7 +832,7 @@ func (b *Cloud) Operation(ctx context.Context, op *backend.Operation) (*backend.
|
||||
b.opLock.Lock()
|
||||
|
||||
// Build our running operation
|
||||
// the runninCtx is only used to block until the operation returns.
|
||||
// the runningCtx is only used to block until the operation returns.
|
||||
runningCtx, done := context.WithCancel(context.Background())
|
||||
runningOp := &backend.RunningOperation{
|
||||
Context: runningCtx,
|
||||
@ -922,7 +922,7 @@ func (b *Cloud) cancel(cancelCtx context.Context, op *backend.Operation, r *tfe.
|
||||
}
|
||||
} else {
|
||||
if b.CLI != nil {
|
||||
// Insert a blank line to separate the ouputs.
|
||||
// Insert a blank line to separate the outputs.
|
||||
b.CLI.Output("")
|
||||
}
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ func (b *Cloud) opApply(stopCtx, cancelCtx context.Context, op *backend.Operatio
|
||||
return r, errApplyNeedsUIConfirmation
|
||||
} else {
|
||||
// If we don't need to ask for confirmation, insert a blank
|
||||
// line to separate the ouputs.
|
||||
// line to separate the outputs.
|
||||
if b.CLI != nil {
|
||||
b.CLI.Output("")
|
||||
}
|
||||
|
@ -1245,7 +1245,7 @@ func TestCloud_applyLockTimeout(t *testing.T) {
|
||||
t.Fatalf("expected TFC header in output: %s", output)
|
||||
}
|
||||
if !strings.Contains(output, "Lock timeout exceeded") {
|
||||
t.Fatalf("expected lock timout error in output: %s", output)
|
||||
t.Fatalf("expected lock timeout error in output: %s", output)
|
||||
}
|
||||
if strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
|
||||
t.Fatalf("unexpected plan summery in output: %s", output)
|
||||
@ -1638,7 +1638,7 @@ func TestCloud_applyPolicySoftFailAutoApproveSuccess(t *testing.T) {
|
||||
}
|
||||
|
||||
if run.PlanEmpty {
|
||||
t.Fatalf("expected plan to not be empty, plan opertion completed without error")
|
||||
t.Fatalf("expected plan to not be empty, plan operation completed without error")
|
||||
}
|
||||
|
||||
if len(input.answers) != 0 {
|
||||
@ -1652,7 +1652,7 @@ func TestCloud_applyPolicySoftFailAutoApproveSuccess(t *testing.T) {
|
||||
|
||||
output := b.CLI.(*cli.MockUi).OutputWriter.String()
|
||||
if !strings.Contains(output, "Sentinel Result: false") {
|
||||
t.Fatalf("expected policy check to be false, insead got: %s", output)
|
||||
t.Fatalf("expected policy check to be false, instead got: %s", output)
|
||||
}
|
||||
if !strings.Contains(output, "Apply complete!") {
|
||||
t.Fatalf("expected apply to be complete, instead got: %s", output)
|
||||
|
@ -72,7 +72,7 @@ func (b *Cloud) waitForRun(stopCtx, cancelCtx context.Context, op *backend.Opera
|
||||
b.CLI.Output(b.Colorize().Color(fmt.Sprintf("Waiting for the %s to start...\n", opType)))
|
||||
}
|
||||
if i > 0 && b.CLI != nil {
|
||||
// Insert a blank line to separate the ouputs.
|
||||
// Insert a blank line to separate the outputs.
|
||||
b.CLI.Output("")
|
||||
}
|
||||
return r, nil
|
||||
|
@ -291,7 +291,7 @@ func (v *remoteStoredVariableValue) ParseVariableValue(mode configs.VariablePars
|
||||
// We mark these as "from input" with the rationale that entering
|
||||
// variable values into the Terraform Cloud or Enterprise UI is,
|
||||
// roughly speaking, a similar idea to entering variable values at
|
||||
// the interactive CLI prompts. It's not a perfect correspondance,
|
||||
// the interactive CLI prompts. It's not a perfect correspondence,
|
||||
// but it's closer than the other options.
|
||||
SourceType: tofu.ValueFromInput,
|
||||
}, diags
|
||||
|
@ -103,7 +103,7 @@ func (b *Cloud) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operation
|
||||
}
|
||||
}
|
||||
|
||||
// Everything succeded, so display next steps
|
||||
// Everything succeeded, so display next steps
|
||||
op.View.PlanNextStep(op.PlanOutPath, op.GenerateConfigOut)
|
||||
|
||||
return run, nil
|
||||
@ -307,7 +307,7 @@ in order to capture the filesystem context the remote workspace expects:
|
||||
b.CLI.Output(b.Colorize().Color(strings.TrimSpace(lockTimeoutErr)))
|
||||
}
|
||||
|
||||
// We abuse the auto aprove flag to indicate that we do not
|
||||
// We abuse the auto approve flag to indicate that we do not
|
||||
// want to ask if the remote operation should be canceled.
|
||||
op.AutoApprove = true
|
||||
|
||||
|
@ -884,7 +884,7 @@ func TestCloud_planLockTimeout(t *testing.T) {
|
||||
t.Fatalf("expected TFC header in output: %s", output)
|
||||
}
|
||||
if !strings.Contains(output, "Lock timeout exceeded") {
|
||||
t.Fatalf("expected lock timout error in output: %s", output)
|
||||
t.Fatalf("expected lock timeout error in output: %s", output)
|
||||
}
|
||||
if strings.Contains(output, "1 to add, 0 to change, 0 to destroy") {
|
||||
t.Fatalf("unexpected plan summary in output: %s", output)
|
||||
|
@ -133,7 +133,7 @@ func TestTaskStagesWithAllStages(t *testing.T) {
|
||||
} {
|
||||
if stage, ok := taskStages[stageName]; ok {
|
||||
if stage.Stage != stageName {
|
||||
t.Errorf("Expected task stage indexed by %s to find a Task Stage with the same index, but receieved %s", stageName, stage.Stage)
|
||||
t.Errorf("Expected task stage indexed by %s to find a Task Stage with the same index, but received %s", stageName, stage.Stage)
|
||||
}
|
||||
} else {
|
||||
t.Errorf("Expected task stage indexed by %s to exist, but it did not", stageName)
|
||||
|
@ -1134,7 +1134,7 @@ func TestApply_shutdown(t *testing.T) {
|
||||
})
|
||||
|
||||
// Because of the internal lock in the MockProvider, we can't
|
||||
// coordiante directly with the calling of Stop, and making the
|
||||
// coordinate directly with the calling of Stop, and making the
|
||||
// MockProvider concurrent is disruptive to a lot of existing tests.
|
||||
// Wait here a moment to help make sure the main goroutine gets to the
|
||||
// Stop call before we exit, or the plan may finish before it can be
|
||||
|
@ -34,7 +34,7 @@ type State struct {
|
||||
LockTimeout time.Duration
|
||||
|
||||
// StatePath specifies a non-default location for the state file. The
|
||||
// default value is blank, which is interpeted as "terraform.tfstate".
|
||||
// default value is blank, which is interpreted as "terraform.tfstate".
|
||||
StatePath string
|
||||
|
||||
// StateOutPath specifies a different path to write the final state file.
|
||||
@ -183,7 +183,7 @@ func (o *Operation) Parse() tfdiags.Diagnostics {
|
||||
}
|
||||
|
||||
// Vars describes arguments which specify non-default variable values. This
|
||||
// interfce is unfortunately obscure, because the order of the CLI arguments
|
||||
// interface is unfortunately obscure, because the order of the CLI arguments
|
||||
// determines the final value of the gathered variables. In future it might be
|
||||
// desirable for the arguments package to handle the gathering of variables
|
||||
// directly, returning a map of variable values.
|
||||
|
@ -64,7 +64,7 @@ func homeDir() (string, error) {
|
||||
// First prefer the HOME environmental variable
|
||||
if home := os.Getenv("HOME"); home != "" {
|
||||
// FIXME: homeDir gets called from globalPluginDirs during init, before
|
||||
// the logging is set up. We should move meta initializtion outside of
|
||||
// the logging is set up. We should move meta initialization outside of
|
||||
// init, but in the meantime we just need to silence this output.
|
||||
// log.Printf("[DEBUG] Detected home directory from env var: %s", home)
|
||||
|
||||
|
@ -360,7 +360,7 @@ func (s *CredentialsSource) updateLocalHostCredentials(host svchost.Hostname, ne
|
||||
return fmt.Errorf("credentials file %s has invalid value for \"credentials\" property: must be a JSON object", filename)
|
||||
}
|
||||
|
||||
// We use display-oriented hostnames in our file to mimick how a human user
|
||||
// We use display-oriented hostnames in our file to mimic how a human user
|
||||
// would write it, so we need to search for and remove any key that
|
||||
// normalizes to our target hostname so we won't generate something invalid
|
||||
// when the existing entry is slightly different.
|
||||
|
@ -62,7 +62,7 @@ func decodeProviderInstallationFromConfig(hclFile *hclast.File) ([]*ProviderInst
|
||||
|
||||
// This is a rather odd hybrid: it's a HCL 2-like decode implemented using
|
||||
// the HCL 1 AST API. That makes it a bit awkward in places, but it allows
|
||||
// us to mimick the strictness of HCL 2 (making a later migration easier)
|
||||
// us to mimic the strictness of HCL 2 (making a later migration easier)
|
||||
// and to support a block structure that the HCL 1 decoder can't represent.
|
||||
for _, block := range root.Items {
|
||||
if block.Keys[0].Token.Value() != "provider_installation" {
|
||||
|
@ -175,7 +175,7 @@ func TestProviderTampering(t *testing.T) {
|
||||
// NOTE: We're just emptying out the lock file here because that's
|
||||
// good enough for what we're trying to assert. The leaf codepath
|
||||
// that generates this family of errors has some different variations
|
||||
// of this error message for otehr sorts of inconsistency, but those
|
||||
// of this error message for other sorts of inconsistency, but those
|
||||
// are tested more thoroughly over in the "configs" package, which is
|
||||
// ultimately responsible for that logic.
|
||||
err := os.WriteFile(filepath.Join(workDir, ".terraform.lock.hcl"), []byte(``), 0600)
|
||||
|
@ -472,7 +472,7 @@ func (c *FmtCommand) formatTypeExpr(tokens hclwrite.Tokens) hclwrite.Tokens {
|
||||
// element type, we use string as the default element
|
||||
// type. That will avoid oddities if somehow the configuration
|
||||
// was relying on numeric values being auto-converted to
|
||||
// string, as 0.11 would do. This mimicks what terraform
|
||||
// string, as 0.11 would do. This mimics what terraform
|
||||
// 0.12upgrade used to do, because we'd found real-world
|
||||
// modules that were depending on the auto-stringing.)
|
||||
switch string(strTok.Bytes) {
|
||||
|
@ -208,7 +208,7 @@ func DiagnosticWarningsCompact(diags tfdiags.Diagnostics, color *colorstring.Col
|
||||
}
|
||||
} else if len(sources) > 1 {
|
||||
b.WriteString(fmt.Sprintf(
|
||||
" (%d occurences of this warning)\n",
|
||||
" (%d occurrences of this warning)\n",
|
||||
len(sources),
|
||||
))
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ func (c *InitCommand) getModules(ctx context.Context, path, testsDir string, ear
|
||||
|
||||
func (c *InitCommand) initCloud(ctx context.Context, root *configs.Module, extraConfig rawFlags, enc encryption.Encryption) (be backend.Backend, output bool, diags tfdiags.Diagnostics) {
|
||||
ctx, span := tracer.Start(ctx, "initialize cloud backend")
|
||||
_ = ctx // prevent staticcheck from complaining to avoid a maintenence hazard of having the wrong ctx in scope here
|
||||
_ = ctx // prevent staticcheck from complaining to avoid a maintenance hazard of having the wrong ctx in scope here
|
||||
defer span.End()
|
||||
|
||||
c.Ui.Output(c.Colorize().Color("\n[reset][bold]Initializing cloud backend..."))
|
||||
@ -465,7 +465,7 @@ func (c *InitCommand) initCloud(ctx context.Context, root *configs.Module, extra
|
||||
|
||||
func (c *InitCommand) initBackend(ctx context.Context, root *configs.Module, extraConfig rawFlags, enc encryption.Encryption) (be backend.Backend, output bool, diags tfdiags.Diagnostics) {
|
||||
ctx, span := tracer.Start(ctx, "initialize backend")
|
||||
_ = ctx // prevent staticcheck from complaining to avoid a maintenence hazard of having the wrong ctx in scope here
|
||||
_ = ctx // prevent staticcheck from complaining to avoid a maintenance hazard of having the wrong ctx in scope here
|
||||
defer span.End()
|
||||
|
||||
c.Ui.Output(c.Colorize().Color("\n[reset][bold]Initializing the backend..."))
|
||||
@ -1195,7 +1195,7 @@ Options:
|
||||
itself.
|
||||
|
||||
-force-copy Suppress prompts about copying state data when
|
||||
initializating a new state backend. This is
|
||||
initializing a new state backend. This is
|
||||
equivalent to providing a "yes" to all confirmation
|
||||
prompts.
|
||||
|
||||
|
@ -471,7 +471,7 @@ func TestInit_backendConfigFilePowershellConfusion(t *testing.T) {
|
||||
//
|
||||
// Adding the "=" here forces this codepath to be checked, and it should
|
||||
// result in an early exit with a diagnostic that the provided
|
||||
// configuration file is not a diretory.
|
||||
// configuration file is not a directory.
|
||||
args := []string{"-backend-config=", "./input.config"}
|
||||
if code := c.Run(args); code != 1 {
|
||||
t.Fatalf("got exit status %d; want 1\nstderr:\n%s\n\nstdout:\n%s", code, ui.ErrorWriter.String(), ui.OutputWriter.String())
|
||||
|
@ -337,7 +337,7 @@ func marshalModule(c *configs.Config, schemas *tofu.Schemas, addr string) (modul
|
||||
ref, diags := addrs.ParseRef(d)
|
||||
// we should not get an error here, because `tofu validate`
|
||||
// would have complained well before this point, but if we do we'll
|
||||
// silenty skip it.
|
||||
// silently skip it.
|
||||
if !diags.HasErrors() {
|
||||
dependencies[i] = ref.Subject.String()
|
||||
}
|
||||
@ -432,7 +432,7 @@ func marshalModuleCall(c *configs.Config, mc *configs.ModuleCall, schemas *tofu.
|
||||
ref, diags := addrs.ParseRef(d)
|
||||
// we should not get an error here, because `tofu validate`
|
||||
// would have complained well before this point, but if we do we'll
|
||||
// silenty skip it.
|
||||
// silently skip it.
|
||||
if !diags.HasErrors() {
|
||||
dependencies[i] = ref.Subject.String()
|
||||
}
|
||||
@ -505,7 +505,7 @@ func marshalResources(resources map[string]*configs.Resource, schemas *tofu.Sche
|
||||
ref, diags := addrs.ParseRef(d)
|
||||
// we should not get an error here, because `tofu validate`
|
||||
// would have complained well before this point, but if we do we'll
|
||||
// silenty skip it.
|
||||
// silently skip it.
|
||||
if !diags.HasErrors() {
|
||||
dependencies[i] = ref.Subject.String()
|
||||
}
|
||||
@ -523,7 +523,7 @@ func marshalResources(resources map[string]*configs.Resource, schemas *tofu.Sche
|
||||
|
||||
// Flatten all resource provider keys in a module and its descendents, such
|
||||
// that any resources from providers using a configuration passed through the
|
||||
// module call have a direct refernce to that provider configuration.
|
||||
// module call have a direct reference to that provider configuration.
|
||||
func normalizeModuleProviderKeys(m *module, pcs map[string]providerConfig) {
|
||||
for i, r := range m.Resources {
|
||||
if pc, exists := pcs[r.ProviderConfigKey]; exists {
|
||||
|
@ -55,8 +55,8 @@ func marshalExpression(ex hcl.Expression) expression {
|
||||
var varString []string
|
||||
for _, ref := range refs {
|
||||
// We work backwards here, starting with the full reference +
|
||||
// reamining traversal, and then unwrapping the remaining traversals
|
||||
// into parts until we end up at the smallest referencable address.
|
||||
// remaining traversal, and then unwrapping the remaining traversals
|
||||
// into parts until we end up at the smallest referenceable address.
|
||||
remains := ref.Remaining
|
||||
for len(remains) > 0 {
|
||||
varString = append(varString, fmt.Sprintf("%s%s", ref.Subject, traversalStr(remains)))
|
||||
|
@ -74,7 +74,7 @@ func TestMarshalReturnType(t *testing.T) {
|
||||
t.Run(tn, func(t *testing.T) {
|
||||
actual := marshalReturnType(tc.Arg)
|
||||
|
||||
// to avoid the nightmare of comparing cty primitve types we can marshal them to json and compare that
|
||||
// to avoid the nightmare of comparing cty primitive types we can marshal them to json and compare that
|
||||
actualJSON, _ := json.Marshal(actual)
|
||||
expectedJSON, _ := json.Marshal(tc.Expected)
|
||||
if !cmp.Equal(actualJSON, expectedJSON) {
|
||||
@ -122,7 +122,7 @@ func TestMarshalParameter(t *testing.T) {
|
||||
t.Run(tn, func(t *testing.T) {
|
||||
actual := marshalParameter(tc.Arg)
|
||||
|
||||
// to avoid the nightmare of comparing cty primitve types we can marshal them to json and compare that
|
||||
// to avoid the nightmare of comparing cty primitive types we can marshal them to json and compare that
|
||||
actualJSON, _ := json.Marshal(actual)
|
||||
expectedJSON, _ := json.Marshal(tc.Expected)
|
||||
if !cmp.Equal(actualJSON, expectedJSON) {
|
||||
@ -155,7 +155,7 @@ func TestMarshalParameters(t *testing.T) {
|
||||
t.Run(tn, func(t *testing.T) {
|
||||
actual := marshalParameters(tc.Arg)
|
||||
|
||||
// to avoid the nightmare of comparing cty primitve types we can marshal them to json and compare that
|
||||
// to avoid the nightmare of comparing cty primitive types we can marshal them to json and compare that
|
||||
actualJSON, _ := json.Marshal(actual)
|
||||
expectedJSON, _ := json.Marshal(tc.Expected)
|
||||
if !cmp.Equal(actualJSON, expectedJSON) {
|
||||
@ -206,7 +206,7 @@ func TestMarshalFunction(t *testing.T) {
|
||||
t.Run(tn, func(t *testing.T) {
|
||||
actual := marshalFunction(tc.Arg)
|
||||
|
||||
// to avoid the nightmare of comparing cty primitve types we can marshal them to json and compare that
|
||||
// to avoid the nightmare of comparing cty primitive types we can marshal them to json and compare that
|
||||
actualJSON, _ := json.Marshal(actual)
|
||||
expectedJSON, _ := json.Marshal(tc.Expected)
|
||||
if !cmp.Equal(actualJSON, expectedJSON) {
|
||||
@ -239,7 +239,7 @@ func TestMarshalFunctions(t *testing.T) {
|
||||
t.Run(tn, func(t *testing.T) {
|
||||
actual := marshalFunctions(tc.Arg)
|
||||
|
||||
// to avoid the nightmare of comparing cty primitve types we can marshal them to json and compare that
|
||||
// to avoid the nightmare of comparing cty primitive types we can marshal them to json and compare that
|
||||
actualJSON, _ := json.Marshal(actual)
|
||||
expectedJSON, _ := json.Marshal(tc.Expected)
|
||||
if !cmp.Equal(actualJSON, expectedJSON) {
|
||||
|
@ -38,7 +38,7 @@ func newProviders() *Providers {
|
||||
}
|
||||
}
|
||||
|
||||
// MarshalForRenderer converts the provided internation representation of the
|
||||
// MarshalForRenderer converts the provided internal representation of the
|
||||
// schema into the public structured JSON versions.
|
||||
//
|
||||
// This is a format that can be read by the structured plan renderer.
|
||||
|
@ -781,7 +781,7 @@ func (c *LoginCommand) listenerForCallback(minPort, maxPort uint16) (net.Listene
|
||||
}
|
||||
|
||||
func (c *LoginCommand) proofKey() (key, challenge string, err error) {
|
||||
// Wel use a UUID-like string as the "proof key for code exchange" (PKCE)
|
||||
// We'll use a UUID-like string as the "proof key for code exchange" (PKCE)
|
||||
// that will eventually authenticate our request to the token endpoint.
|
||||
// Standard UUIDs are explicitly not suitable as secrets according to the
|
||||
// UUID spec, but our go-uuid just generates totally random number sequences
|
||||
|
@ -312,7 +312,7 @@ func TestLogin(t *testing.T) {
|
||||
// The following test does not use browser MockLauncher() and forces `tofu login` command print URL
|
||||
// and wait for the callback with code.
|
||||
// There is no timeout in `tofu login` OAuth2 callback server code, so the only way to interrupt it
|
||||
// is to wirte to the shutdown channel (or complete the login process).
|
||||
// is to write to the shutdown channel (or complete the login process).
|
||||
t.Run("example.com Ctrl+C interrupts login command", loginTestCase(func(t *testing.T, c *LoginCommand, ui *cli.MockUi) {
|
||||
// Enter "yes" at the consent prompt.
|
||||
defer testInputMap(t, map[string]string{
|
||||
|
@ -436,7 +436,7 @@ func (m *Meta) Operation(b backend.Backend, vt arguments.ViewType, enc encryptio
|
||||
// should always have been called earlier to prepare the "ContextOpts"
|
||||
// for the backend anyway, so we should never actually get here in
|
||||
// a real situation. If we do get here then the backend will inevitably
|
||||
// fail downstream somwhere if it tries to use the empty depLocks.
|
||||
// fail downstream somewhere if it tries to use the empty depLocks.
|
||||
log.Printf("[WARN] Failed to load dependency locks while preparing backend operation (ignored): %s", diags.Err().Error())
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ func (m *Meta) backendMigrateState_S_s(opts *backendMigrateOpts) error {
|
||||
// Copy the default state
|
||||
opts.sourceWorkspace = currentWorkspace
|
||||
|
||||
// now switch back to the default env so we can acccess the new backend
|
||||
// now switch back to the default env so we can access the new backend
|
||||
m.SetWorkspace(backend.DefaultStateName)
|
||||
|
||||
return m.backendMigrateState_s_s(opts)
|
||||
@ -452,7 +452,7 @@ func (m *Meta) backendMigrateState_s_s(opts *backendMigrateOpts) error {
|
||||
// The backend is currently handled before providers are installed during init,
|
||||
// so requiring schemas here could lead to a catch-22 where it requires some manual
|
||||
// intervention to proceed far enough for provider installation. To avoid this,
|
||||
// when migrating to TFC backend, the initial JSON varient of state won't be generated and stored.
|
||||
// when migrating to TFC backend, the initial JSON variant of state won't be generated and stored.
|
||||
if err := destinationState.PersistState(nil); err != nil {
|
||||
return fmt.Errorf(strings.TrimSpace(errBackendStateCopy),
|
||||
opts.SourceType, opts.DestinationType, err)
|
||||
@ -559,7 +559,7 @@ func (m *Meta) backendMigrateTFC(opts *backendMigrateOpts) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
//to be used below, not yet implamented
|
||||
// to be used below, not yet implemented
|
||||
// destinationWorkspaces, destinationSingleState
|
||||
_, _, err = retrieveWorkspaces(opts.Destination, opts.SourceType)
|
||||
if err != nil {
|
||||
@ -655,7 +655,7 @@ func (m *Meta) backendMigrateTFC(opts *backendMigrateOpts) error {
|
||||
}
|
||||
|
||||
// TODO(omar): after the check for sourceSingle is done, everything following
|
||||
// it has to be multi. So rework the code to not need to check for multi, adn
|
||||
// it has to be multi. So rework the code to not need to check for multi, and
|
||||
// return m.backendMigrateState_S_TFC here.
|
||||
return nil
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ func (m *Meta) loadSingleModuleWithTests(dir string, testDir string) (*configs.M
|
||||
// least one OpenTofu configuration file (.tf or .tf.json), returning true
|
||||
// if so.
|
||||
//
|
||||
// In the unlikely event that the underlying config loader cannot be initalized,
|
||||
// In the unlikely event that the underlying config loader cannot be initialized,
|
||||
// this function optimistically returns true, assuming that the caller will
|
||||
// then do some other operation that requires the config loader and get an
|
||||
// error at that point.
|
||||
|
@ -69,7 +69,7 @@ func (m *Meta) collectVariableValues() (map[string]backend.UnparsedVariableValue
|
||||
}
|
||||
|
||||
// Next up we load implicit files from the specified directory (first root then tests dir
|
||||
// as tests dir files have higher precendence). These files are automatically loaded if present.
|
||||
// as tests dir files have higher precedence). These files are automatically loaded if present.
|
||||
// There's the original terraform.tfvars (DefaultVarsFilename) along with the later-added
|
||||
// search for all files ending in .auto.tfvars.
|
||||
diags = diags.Append(m.addVarsFromDir(".", ret))
|
||||
|
@ -158,7 +158,7 @@ func TestProviders_state(t *testing.T) {
|
||||
"provider[registry.opentofu.org/hashicorp/foo] 1.0.0", // from required_providers
|
||||
"provider[registry.opentofu.org/hashicorp/bar] 2.0.0", // from a provider config block
|
||||
"Providers required by state", // header for state providers
|
||||
"provider[registry.opentofu.org/hashicorp/baz]", // from a resouce in state (only)
|
||||
"provider[registry.opentofu.org/hashicorp/baz]", // from a resource in state (only)
|
||||
}
|
||||
|
||||
output := ui.OutputWriter.String()
|
||||
|
@ -38,7 +38,7 @@
|
||||
"schema_version": 0,
|
||||
"attributes": {
|
||||
"ami": "ami-test",
|
||||
"id": "placeheld"
|
||||
"id": "placeholder"
|
||||
},
|
||||
"sensitive_attributes": [
|
||||
[
|
||||
|
@ -53,7 +53,7 @@
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"ami": "ami-test",
|
||||
"id": "placeheld",
|
||||
"id": "placeholder",
|
||||
"password": null
|
||||
},
|
||||
"sensitive_values": {
|
||||
|
@ -2,7 +2,7 @@ variable "otherresourcename" {
|
||||
default = "aws_instance.web1"
|
||||
}
|
||||
|
||||
variable "vairable_with_interpolation" {
|
||||
variable "variable_with_interpolation" {
|
||||
default = "${var.otherresourcename}"
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
}
|
||||
},
|
||||
"snippet": {
|
||||
"context": "variable \"vairable_with_interpolation\"",
|
||||
"context": "variable \"variable_with_interpolation\"",
|
||||
"code": " default = \"${var.otherresourcename}\"",
|
||||
"start_line": 6,
|
||||
"highlight_start_offset": 15,
|
||||
|
@ -122,7 +122,7 @@ func TestValidateFailingCommandMissingVariable(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSameProviderMutipleTimesShouldFail(t *testing.T) {
|
||||
func TestSameProviderMultipleTimesShouldFail(t *testing.T) {
|
||||
output, code := setupTest(t, "validate-invalid/multiple_providers")
|
||||
if code != 1 {
|
||||
t.Fatalf("Should have failed: %d\n\n%s", code, output.Stderr())
|
||||
@ -221,7 +221,7 @@ func TestMissingDefinedVar(t *testing.T) {
|
||||
func TestValidateWithInvalidTestFile(t *testing.T) {
|
||||
|
||||
// We're reusing some testing configs that were written for testing the
|
||||
// test command here, so we have to initalise things slightly differently
|
||||
// test command here, so we have to initialise things slightly differently
|
||||
// to the other tests.
|
||||
|
||||
view, done := testView(t)
|
||||
@ -253,7 +253,7 @@ func TestValidateWithInvalidTestFile(t *testing.T) {
|
||||
func TestValidateWithInvalidTestModule(t *testing.T) {
|
||||
|
||||
// We're reusing some testing configs that were written for testing the
|
||||
// test command here, so we have to initalise things slightly differently
|
||||
// test command here, so we have to initialise things slightly differently
|
||||
// to the other tests.
|
||||
|
||||
td := t.TempDir()
|
||||
|
@ -571,7 +571,7 @@ func testStatus(status moduletest.Status) string {
|
||||
}
|
||||
}
|
||||
|
||||
// SaveErroredTestStateFile is a helper function to invoked in DestorySummary
|
||||
// SaveErroredTestStateFile is a helper function to invoked in DestroySummary
|
||||
// to store the state to errored_test.tfstate and handle associated diagnostics and errors with this operation
|
||||
func SaveErroredTestStateFile(state *states.State, run *moduletest.Run, file *moduletest.File, view Test) {
|
||||
var diags tfdiags.Diagnostics
|
||||
|
@ -64,7 +64,7 @@ func NewView(streams *terminal.Streams) *View {
|
||||
// instead for situations where the user isn't running OpenTofu directly.
|
||||
//
|
||||
// For convenient use during initialization (in conjunction with NewView),
|
||||
// SetRunningInAutomation returns the reciever after modifying it.
|
||||
// SetRunningInAutomation returns the receiver after modifying it.
|
||||
func (v *View) SetRunningInAutomation(new bool) *View {
|
||||
v.runningInAutomation = new
|
||||
return v
|
||||
|
@ -61,7 +61,7 @@ type MockLauncher struct {
|
||||
// would naturally complete.
|
||||
Context context.Context
|
||||
|
||||
// Responses is a log of all of the responses recieved from the launcher's
|
||||
// Responses is a log of all of the responses received from the launcher's
|
||||
// requests, in the order requested.
|
||||
Responses []*http.Response
|
||||
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
// "Working directory" is unfortunately a slight misnomer, because non-default
|
||||
// options can potentially stretch the definition such that multiple working
|
||||
// directories end up appearing to share a data directory, or other similar
|
||||
// anomolies, but we continue to use this terminology both for historical
|
||||
// anomalies, but we continue to use this terminology both for historical
|
||||
// reasons and because it reflects the common case without any special
|
||||
// overrides.
|
||||
//
|
||||
@ -84,7 +84,7 @@ func NewDir(mainPath string) *Dir {
|
||||
}
|
||||
|
||||
// OverrideOriginalWorkingDir records a different path as the
|
||||
// "original working directory" for the reciever.
|
||||
// "original working directory" for the receiver.
|
||||
//
|
||||
// Use this only to record the original working directory when OpenTofu is run
|
||||
// with the -chdir=... global option. In that case, the directory given in
|
||||
@ -125,7 +125,7 @@ func (d *Dir) OriginalWorkingDir() string {
|
||||
return d.originalDir
|
||||
}
|
||||
|
||||
// DataDir returns the base path where the reciever keeps all of the settings
|
||||
// DataDir returns the base path where the receiver keeps all of the settings
|
||||
// and artifacts that must persist between consecutive commands in a single
|
||||
// session.
|
||||
//
|
||||
|
@ -604,7 +604,7 @@ func (c *Communicator) scpSession(scpCommand string, f func(io.Writer, *bufio.Re
|
||||
|
||||
if err != nil {
|
||||
if exitErr, ok := err.(*ssh.ExitError); ok {
|
||||
// Otherwise, we have an ExitErorr, meaning we can just read
|
||||
// Otherwise, we have an ExitError, meaning we can just read
|
||||
// the exit status
|
||||
log.Printf("[ERROR] %s", exitErr)
|
||||
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPasswordKeybardInteractive_Challenge(t *testing.T) {
|
||||
func TestPasswordKeyboardInteractive_Challenge(t *testing.T) {
|
||||
p := PasswordKeyboardInteractive("foo")
|
||||
result, err := p("foo", "bar", []string{"one", "two"}, nil)
|
||||
if err != nil {
|
||||
|
@ -36,7 +36,7 @@ func decodeBackendBlock(block *hcl.Block) (*Backend, hcl.Diagnostics) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Hash produces a hash value for the reciever that covers the type and the
|
||||
// Hash produces a hash value for the receiver that covers the type and the
|
||||
// portions of the config that conform to the given schema.
|
||||
//
|
||||
// If the config does not conform to the schema then the result is not
|
||||
|
@ -212,7 +212,7 @@ func (c *Config) EntersNewPackage() bool {
|
||||
|
||||
// VerifyDependencySelections checks whether the given locked dependencies
|
||||
// are acceptable for all of the version constraints reported in the
|
||||
// configuration tree represented by the reciever.
|
||||
// configuration tree represented by the receiver.
|
||||
//
|
||||
// This function will errors only if any of the locked dependencies are out of
|
||||
// range for corresponding constraints in the configuration. If there are
|
||||
|
@ -304,7 +304,7 @@ type ModuleRequest struct {
|
||||
CallRange hcl.Range
|
||||
|
||||
// This is where variables and other information from the calling module
|
||||
// are propogated to the child module for use in the static evaluator
|
||||
// are propagated to the child module for use in the static evaluator
|
||||
Call StaticModuleCall
|
||||
}
|
||||
|
||||
|
@ -9,12 +9,12 @@ import (
|
||||
"github.com/zclconf/go-cty/cty"
|
||||
)
|
||||
|
||||
// EmptyValue returns the "empty value" for the recieving block, which for
|
||||
// EmptyValue returns the "empty value" for the receiving block, which for
|
||||
// a block type is a non-null object where all of the attribute values are
|
||||
// the empty values of the block's attributes and nested block types.
|
||||
//
|
||||
// In other words, it returns the value that would be returned if an empty
|
||||
// block were decoded against the recieving schema, assuming that no required
|
||||
// block were decoded against the receiving schema, assuming that no required
|
||||
// attribute or block constraints were honored.
|
||||
func (b *Block) EmptyValue() cty.Value {
|
||||
vals := make(map[string]cty.Value)
|
||||
|
@ -133,7 +133,7 @@ const (
|
||||
NestingSingle
|
||||
|
||||
// NestingGroup is similar to NestingSingle in that it calls for only a
|
||||
// single instance of a given block type with no labels, but it additonally
|
||||
// single instance of a given block type with no labels, but it additionally
|
||||
// guarantees that its result will never be null, even if the block is
|
||||
// absent, and instead the nested attributes and blocks will be treated
|
||||
// as absent in that case. (Any required attributes or blocks within the
|
||||
|
@ -146,7 +146,7 @@ var importBlockSchema = &hcl.BodySchema{
|
||||
// but we don't really care about the key part of it. We just want a traversal that could be converted to an address
|
||||
// of a resource, so we could determine the module + resource + provider
|
||||
//
|
||||
// Currently, there are 4 types of HCL epressions that support AsTraversal:
|
||||
// Currently, there are 4 types of HCL expressions that support AsTraversal:
|
||||
// - hclsyntax.ScopeTraversalExpr - Simply returns the Traversal. Same for our use-case here
|
||||
// - hclsyntax.RelativeTraversalExpr - Calculates hcl.AbsTraversalForExpr for the Source, and adds the Traversal to it. Same here, with absTraversalForImportToExpr instead
|
||||
// - hclsyntax.LiteralValueExpr - Mainly for null/false/true values. Not relevant in our use-case, as it's could not really be part of a reference (unless it is inside of an index, which is irrelevant here anyway)
|
||||
|
@ -75,7 +75,7 @@ func (v *Variable) merge(ov *Variable) hcl.Diagnostics {
|
||||
// but in particular might be user-observable in the edge case where the
|
||||
// literal value in config could've been converted to the overridden type
|
||||
// constraint but the converted value cannot. In practice, this situation
|
||||
// should be rare since most of our conversions are interchangable.
|
||||
// should be rare since most of our conversions are interchangeable.
|
||||
if v.Default != cty.NilVal {
|
||||
val, err := convert.Convert(v.Default, v.ConstraintType)
|
||||
if err != nil {
|
||||
|
@ -110,7 +110,7 @@ func (p Parser) ConfigDirFilesWithTests(dir string, testDirectory string) (prima
|
||||
|
||||
// IsConfigDir determines whether the given path refers to a directory that
|
||||
// exists and contains at least one OpenTofu config file (with a .tf or
|
||||
// .tf.json extension.). Note, we explicitely exclude checking for tests here
|
||||
// .tf.json extension.). Note, we explicitly exclude checking for tests here
|
||||
// as tests must live alongside actual .tf config files.
|
||||
func (p *Parser) IsConfigDir(path string) bool {
|
||||
primaryPaths, overridePaths, _, _ := p.dirFiles(path, "")
|
||||
|
@ -100,7 +100,7 @@ func decodeProvisionerBlock(block *hcl.Block) (*Provisioner, hcl.Diagnostics) {
|
||||
Severity: hcl.DiagError,
|
||||
Summary: "Duplicate escaping block",
|
||||
Detail: fmt.Sprintf(
|
||||
"The special block type \"_\" can be used to force particular arguments to be interpreted as provisioner-typpe-specific rather than as meta-arguments, but each provisioner block can have only one such block. The first escaping block was at %s.",
|
||||
"The special block type \"_\" can be used to force particular arguments to be interpreted as provisioner-type-specific rather than as meta-arguments, but each provisioner block can have only one such block. The first escaping block was at %s.",
|
||||
seenEscapeBlock.DefRange,
|
||||
),
|
||||
Subject: &block.DefRange,
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
"github.com/zclconf/go-cty/cty"
|
||||
)
|
||||
|
||||
// StaticIdentifier holds a Referencable item and where it was declared
|
||||
// StaticIdentifier holds a Referenceable item and where it was declared
|
||||
type StaticIdentifier struct {
|
||||
Module addrs.Module
|
||||
Subject string
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user